Jump to content

sanchez77

Members
  • Posts

    139
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

sanchez77's Achievements

Member

Member (2/5)

0

Reputation

  1. that was it. I took that id from another generated array and volia. Thanks kicken. Much appreciation.
  2. So, i think that it's array in an array and then an object, so to go to array then object i would use: $array[0]->x; but how you go to the same array's array? this didn't work either. $array[0]->array[1]->x;
  3. So here is my array: array(1) { ["84EA0353-58EB-E311-A8B1-001D09E7525D"]=> array(1) { [0]=> object(stdClass)#7 (1) { ["data"]=> array(2) { ["amt"]=> string(7) "100.000" ["unit"]=> string(3) "BUC" } } }} I'm trying to set the variable $x to = amt. I've tried $x= $ArrayMap->amt; this but it comes up null. I've also tried: $x= $ArrayMap['amt']; But both come up NULL. Any ideas on what I'm doing wrong? Thanks, sanchez
  4. i did....and it didn't work
  5. Thanks, but the script never ran using that. Should i use shell_exec instead?
  6. so does that mean i can't use exec to execute psexec and pass variables to it?
  7. I'm using the PSTools psexec tool tp execute a script. But I can't figure out how to pass arguments to it. I've tried exec('C:\PSTools\psexec -d "C:\Program Files (x86)\PHP\php-cgi.exe" C:\inetpub\wwwroot\bkupdate.php "$var1" "$var2" ' ); exec('C:\PSTools\psexec -d "C:\Program Files (x86)\PHP\php-cgi.exe" C:\inetpub\wwwroot\bkupdate.php <$var1 $var2> ' ); and exec('C:\PSTools\psexec -d "C:\Program Files (x86)\PHP\php-cgi.exe" C:\inetpub\wwwroot\bkupdate.php [$var1 $var2] ' ); Has anyone done something similar? Doe anyone know how to do that? Thanks, sanchez
  8. Well, i started a new approach. I'm using the PSTools psexec tool and it works, it executes the script and the app doesn't wait. But I can't figure out how to pass arguments to it. I've tried exec('C:\PSTools\psexec -d "C:\Program Files (x86)\PHP\php-cgi.exe" C:\inetpub\wwwroot\bkupdate.php "$var1" "$var2" ' ); exec('C:\PSTools\psexec -d "C:\Program Files (x86)\PHP\php-cgi.exe" C:\inetpub\wwwroot\bkupdate.php <$var1 $var2> ' ); and exec('C:\PSTools\psexec -d "C:\Program Files (x86)\PHP\php-cgi.exe" C:\inetpub\wwwroot\bkupdate.php [$var1 $var2] ' ); Any ideas? really am thankful for your help. Thanks
  9. the rest of it uses SSH to process commands. my intent is to have that script just execute and run and then have the web page move forward without waiting for the script to finish.
  10. ok, thanks ,I got it to work. Appreciate it. So my whole purpose was to make a seperate php file so it could execute and then i could tell the browser to move on and not wait for the return, but it still waits for the return. In the php file I put the following that I got from this site: http://andrewensley.com/2009/06/php-redirect-and-continue-without-abort/ any ideas why it still waits for the page to complete? <?php //Redirect to index.php header("Location: index.php"); //Erase the output buffer ob_end_clean(); //Tell the browser that the connection's closed header("Connection: close"); //Ignore the user's abort (which we caused with the redirect). ignore_user_abort(true); //Extend time limit to 30 minutes set_time_limit(1800); //Extend memory limit to 10MB ini_set("memory_limit","10M"); //Start output buffering again ob_start(); //Tell the browser we're serious... there's really //nothing else to receive from this page. header("Content-Length: 0"); //Send the output buffer and turn output buffering off. ob_end_flush(); //Yes... flush again. flush(); //Close the session. session_write_close(); //the rest of the script ?>
  11. Maybe I'm missing it in the bat file? Here are the three files test.php <?php set_time_limit(0); $argv1 = "123456"; $output = shell_exec('test.bat -- {$argv1[]} &'); echo "<pre>$output</pre>"; ?> test.bat "C:\Program Files (x86)\PHP\php-cgi.exe" -f C:\inetpub\test\bkupdate.php bkupdate.php <?php set_time_limit(0); if ($argc >= 2) { // script name always comes first, so $argc=2 means 1 argument echo "argv[1] = {$argv[1]}\n";} echo "Argv1: ".$argv1."<br>"; //rest of the script ?>
  12. well i'm able to execute the bat file which executes the php script. The PHP script has a function that needs two variables passed to it, i'm wondering how to do that. I even tried $output = shell_exec('test.bat -- ".$argv1." &'); So I'm using PHP to execute a bat file that executes a PHP script.
  13. Thanks, I appreciate your insight. I do have complete control of the server, so I'm trying anything that works And sorry, forgot to mention that I am running PHP on Windows Server 2008. I did this, simple, from the manual, but my question is how do you pass a variable to it? set_time_limit(0); $output = shell_exec('test.bat'); echo "<pre>$output</pre>"; would it be like this? set_time_limit(0); $var1 = "123456"; $output = shell_exec('test.bat -- $var1 &); echo "<pre>$output</pre>";
  14. Does anyone know of a way to execute a function and then not have the browser wait for the return of the function? My intention is for a user to click a button and that will execute the function, then while the function is running, return to the user and let them continue using the app. I did google it and came across popen and ob_flush, not sure what is what and which to use for what i'm trying to do. Any insight is appreciated. Sorry I don't have any code to post.
  15. timeout error failed because I did not have the latest SVN. Fixed that by downloading the latest.
×
×
  • 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.