On Tue, Jul 09, 2002 at 10:59:04PM -0700, Fargo Lee wrote:
> Thanks but it still returns "Success" on a failure. If anyone knows if it is
> even possible to assign the output of system, passthru or exec to a variable
> to check for success or failure and how to do it, please advise. The $status
> variable seems to always be empty on success or failure when I try to echo
> it.

The way you set things up, $status is the last line of text returned by
executing the command.  Add the return_var argument to your system() 
statement.  Take a look at the manual again.

You can only make an accurate if() statement if you know what the values 
are you're expecting.

Now, do some hacking.  Set up the test to fail.  Echo $status and $return
to the screen and see what they look like.  Set up the test to succeed.  
What do $status and $return look like then?


               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to