Re: Searchingfor text within a string
| From: | David Robley | Date: | Wed, 30 Aug 2000 04:21:10 +0000 |
| Subject: | Re: Searchingfor text within a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14312@lists.php.net to get a copy of this message | ||
On 29 Aug, Patrick Brown wrote:
> You are absolutely right, sorry for doubting you. I rewrote the code and it
> looks like this:
>
> <?
> passthru("ping -c 1 $address", $result);
> if ($result == 0){
> echo "Green Light\n";
> } else {
> echo "Red Light\n";
> }
> ?>
>
> I created a simple form that passes the $address variable to this script.
> The results were a bit weird, The output of the ping command is also
> displayed in the browser. How can I get rid of this? If you replace the
> $address variable above with a valid, or invalid, address it works great. I
> only get the weird output when I use the form.
>
> Thanks for your help,
>
> Pat
>
Check out exec which will put the last line of program output - and you
might find the -q switch for ping useful.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA