php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11764 system() function result different from PHP 4.0.5
Submitted: 2001-06-27 22:51 UTC Modified: 2001-07-27 10:48 UTC
From: kamlin at fareastone dot com dot tw Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.6 OS: Windows NT Workstation 4.0
Private report: No CVE-ID: None
 [2001-06-27 22:51 UTC] kamlin at fareastone dot com dot tw
<?php
// goods.php
$today = date("Y/m/d");
$mmdd = substr($today, 5, 2) . substr($today, 8, 2) . ".txt";        
$cmdstr = "php.exe -q goods1.php " . $today . " " . "2001/06/14/11:37:05" . 
             " > Y:\AutoDialer_MKT\REPORT\Pattaya\goods1_" . $mmdd;              
echo $cmdstr . "\n";
system($cmdstr);    


$cmdstr = "php.exe -q goods2.php " . $today . " " . "2001/06/14/11:37:05" . 
             " > Y:\AutoDialer_MKT\REPORT\Pattaya\goods2_" . $mmdd;              
echo $cmdstr . "\n";
system($cmdstr);    

?>

<?php
#
# goods1.php
#
function generate_goods1_report($datestr, $camid)
{
	$linkid = odbc_connect("FET", "SA", "");
	
	if ($linkid)
	{
	    $sqlstr = "SELECT REP.CALL_DATE, REP.CUS_TELNO1, REP.FIRST_NAME, REP.RFU1 FROM REP_CM00001 REP" .
	              " WHERE CAMPAIGN_ID = '" . $camid . "'" .
	              " AND RFU1='1' AND CALL_DATE = '" . $datestr . "'";
            $cur = odbc_exec($linkid, $sqlstr);
            
        print "CALL_DATE,CUS_TELNO1,FIRST_NAME,RFU1\n";
	    while (odbc_fetch_row($cur))
	    {
		    $field1 = odbc_result($cur, 1);
		    $field2 = odbc_result($cur, 2);
		    $field3 = odbc_result($cur, 3);
		    $field4 = odbc_result($cur, 4);
		    
		    $datastr =  $field1 . "," . $field2 . "," . $field3 . "," . $field4 . "\n";
		    print $datastr;
	    }
	    odbc_close($linkid);
	}	
} // function	


// echo "Into goods1.php\n";
// echo "argc == " . $argc . "\n";

if ($argc == 3)
{
    generate_goods1_report($argv[1], $argv[2]);
}    
else 
{
    echo "Usage : php.exe -q goods1.php call_date(YYYY/MM/DD) campaign_id\n";	
}


?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-27 23:01 UTC] sniper@php.net
And what is the difference between 4.0.5 system() and 4.0.6 system() ?


 [2001-06-28 13:02 UTC] sniper@php.net
User feedback:
--------------
In goods1.php  , the value of $argc == 5 (PHP 4.0.6)   , $argc == 3 (PHP
4.0.5)
--------------

If you run this script:

test.php:
<?php echo $HTTP_SERVER_VARS["argc"]; ?>

with this command line:

C:\php.exe -q test.php argument1 argument2

what does it print? The result for me on Windows / Linux
when using PHP 4.0.6 is 3.

And have you ever heard of include() ?

--Jani

 [2001-07-27 10:48 UTC] kalowsky@php.net
no user feedback.  if this problem still persists, please reopen the bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC