Hi everyone, I am new here so if I did not post in the right section then please feel free to move this post to the right section 🙂
So I am having a bit of a problem .. after reading, testing, trying different things, I came to the conclusion that I def need some help on this problem.
I am having 2 files we'll call file1.php and file2.php
I am running apache2.2 on a windows 2003 server and am using php5 .. (please note that register_argc_argv on my server is set to "ON").
I want to call and execute file2.php from file1.php on a command level and pass 2 variables from file1.php to file2.php.
so I am calling file2 for execution from file1.php like this:
$var1 = "1";
$var2 = "sometext";
exec("php.exe -f file2.php ". $var1." ".$var2);
so far so good, file2.php does get called and executes perfectly
now in my file2.php I am trying to pick up $var1 and $var2 that I tried to pass from file1.php .. Like this
$somevar = $argv[1];
$somevar2 = $argv[2];
that's where my problem is .. $var1 and $var2 are not passed ($argv is empty):
Now if I execute a similar code directly from the command line as a test, then the variables are passed properly as expected.
I tried a lot of things and I am kind of at a loss understanding why this does not work .. What could be wrong ?
Thanks in advance for your help 🙂