Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About ping command

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi!

I have small problem. I want to ping a server and the result shouldn't be printed in the browser window, just become a value.

Here you can see the script that I have:

<?
$command=&quot;ping linux.com -t ttl -c1 | tail -1 | awk '{print $4 \&quot; \&quot; $5}'&quot;;
$output = system($command);
system(&quot;exit(0)&quot;);
echo &quot;DATA: $output&quot;;
?>

When I run this in my browser the resualt will be as follow:

33.1/33.1/33.1 ms DATA: 33.1/33.1/33.1 ms

The echo value is just a test for me to see if the $output value is OK.

What I want is that the value before DATA: 33.1/33.1/33.1 ms
shouldn't be viewed in the browser just DATA: 33.1/33.1/33.1 ms

Could someone please help me with this problem?

Best Regards

Peter Håkansson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top