Jump to content

[SOLVED] Pass a PHP Variable to Exec()


hoopplaya4

Recommended Posts

Hey All,

 

I'm trying to pass a PHP variable to another PHP script via Exec().  I am using Exec because I want to run the script in the background to do some processing.  Here's what I currently have:

 

 

$id=$_POST['name'];

exec("php myscript.php?name=" . $id . " >> completed.php &");

 

Now, when I manually browse to the PHP script and run it, it works fine, however, it doesn't work when I try to "exec" it. 

 

It appears that the $id isn't passing.

 

Is there something I'm doing wrong here?  Or is there another way to pass the variable?  Thanks!

 

 

Link to comment
https://forums.phpfreaks.com/topic/140875-solved-pass-a-php-variable-to-exec/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.