rckehoe Posted May 8, 2009 Share Posted May 8, 2009 I have a script, that works just fine... It executes the php file that I want it to... I just have a simple question that I cannot find an answer for anywhere! How do I access the variables that I pass through the exec function? My code is below... When the fork_blast.php page is executed, how do I get the variable there? I want to pass a user ID to this page, because it is going to perform a lengthy task... how do I access the $UserID $PATH=$_SERVER['DOCUMENT_ROOT']; exec ("/usr/bin/php ".$PATH."/fork_blast.php \"".$UserID."\" >/dev/null &"); Quote Link to comment https://forums.phpfreaks.com/topic/157401-solved-simple-exec-fork-question/ Share on other sites More sharing options...
allworknoplay Posted May 8, 2009 Share Posted May 8, 2009 use arguments... $argv[0], $argv[1] etc.... Quote Link to comment https://forums.phpfreaks.com/topic/157401-solved-simple-exec-fork-question/#findComment-829774 Share on other sites More sharing options...
rckehoe Posted May 8, 2009 Author Share Posted May 8, 2009 rock on! Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/157401-solved-simple-exec-fork-question/#findComment-829775 Share on other sites More sharing options...
d.shankar Posted October 3, 2009 Share Posted October 3, 2009 Hello, the above worked for me previously, but it stopped working when i moved to the new host. But EXEC("whoami") works prefectly in this host and register_argc_argv is also set to ON. But i am unable to access the variables that i pass. PLEASE HELP ! Quote Link to comment https://forums.phpfreaks.com/topic/157401-solved-simple-exec-fork-question/#findComment-929665 Share on other sites More sharing options...
d.shankar Posted October 3, 2009 Share Posted October 3, 2009 someone view this topic Quote Link to comment https://forums.phpfreaks.com/topic/157401-solved-simple-exec-fork-question/#findComment-929681 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.