Jump to content

sanchez77

Members
  • Posts

    139
  • Joined

  • Last visited

Everything posted by sanchez77

  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.
  16. Thanks for your help. My post is also on Frost Jedi. But when I tried the code you recommended i received this error in the log for the timeout call: [14-May-2012 14:40:57 UTC] PHP Fatal error: Call to undefined method Net_SSH2::setTimeout() in C:\inetpub\test\testssh6.php on line 8 if I comment that out, I receive this: [14-May-2012 14:36:21 UTC] PHP Warning: Missing argument 1 for Net_SSH2::read(), called in C:\inetpub\test\testssh6.php on line 9 and defined in C:\inetpub\test\phpseclib0.2.2\Net\SSH2.php on line 1768 [14-May-2012 14:36:21 UTC] PHP Notice: Undefined variable: expect in C:\inetpub\test\phpseclib0.2.2\Net\SSH2.php on line 1780 Thanks, sanchez
  17. sanchez77

    SSH2

    I am using the http://phpseclib.sourceforge.net/ and I able to connect to a Unix prompt and login. After login if I send echo $ssh->exec('pwd'); it returns the directory I am in as it should. but when I send this, a command on the box to change db instances. echo $ssh->write("csession instance1 \n"); It just returns a 1. What does the 1 mean? Second question, how can I show what the prompt is returning? I tried echo $ssh->read('[prompt]'); but it fails, I also tried (with changed values for username@password) $output = $ssh->read('#Password:|username@password:~\$#', NET_SSH2_READ_REGEX); echo $output; and that failed as well. Does anyone know what the 1 means and how I could read the return prompt after sending a command? Thanks, sanchez
  18. b/c the old database i need to connect/write to is on a Unix Box. The app I'm building is PHP on Windows Box. I need PHP SSH2 functions to connect to it with PHP but b/c windows sucks, I need to be complie it into it's own version to support the SSH functions. I ran into trouble compling it on Win Srv 2008 box and this was the other choice i thought of to use in writing to the the Unix Box. I'm open to suggestion if you have a better idea. PHP Links: http://us3.php.net/manual/en/ssh2.requirements.php http://us3.php.net/manual/en/ssh2.installation.php Building PHP/Windows https://wiki.php.net/internals/windows/stepbystepbuild Other Post regarding compiling on x64 http://www.phpfreaks.com/forums/index.php?topic=358758.0 I'm able to compile on x86, but because I need to use SSH2 and OpenSSL, I need to complie on the x64 box. I know, just use Unix\Linux. If I could I would. Got a better idea?
  19. I have done little with SOAP, but the little I did, I wrote the call like this instead of using parameters. Hope this helps. $user= "johndoe1"; $password= "snowball"; $SearchCriteria ; $client = new SoapClient("https://servicestest.mcquaig.com/mws.asmx?WSDL"); $result= $client->Find(array('user'=>$user,'password'=>$password,'criteria'=>$SearchCriteria));
  20. check that roger!! That was it, thank you so much. Cheers
  21. yay google!!!! Thanks batwimp, i'm new to VB as well, appreciate the insight. In the example below it's dropping the Text part of the variable. Any ideas on that? <?php $arg1 = 'Test Text'; exec("test.vbs $arg1"); ?> I tried both $arg1 ='Test Text'; and $arg1 = "Test Text"; But it still drops the Text part 'Test Text' when writing to the text file.
  22. I tried both but it still is just writing arg1 instead of test 55 $arg1 = 'test 55'; //exec("test.vbs $arg1"); exec('test.vbs '.$arg1);
  23. Thanks, but the vb script runs with captial Exec and the single quotes. On the vb side it's not putting the value of $arg1, it's putting in $arg1
  24. not the best approach, but try changing the css tag to drop the gallery overlay line 1798 top:200; repalce 200 with the image height
×
×
  • 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.