Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Echo Ping


What I am trying to do is setup a small ping. I was wondering if anyone knew how to setup a ping to ping a website/ip and echo it out to display on a webpage.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Echo: How To View/call Data From Separate File Into Echo
I would like to ask about echo "<--statement==>";

Ok my senario let say like this i got a file name as datax01.php & script.php

Let say on script.php i got a code to use echo. So how from echo i can recall datax01.php to view on that script? Code:

How To Ping....
Im wondering how to ping a server in PHP?

PING By PHP?
I'm using Windows NT (yeah, I know.. :^) and I want to be able to check if another NT PC (not a server) is up before I exec a command to it. Any ideas? I already tried doing:

<CODE>
if (!($ip = fsockopen(gethostbyname("this-pc"), 7, &$errno, &$errstr, 2 ))) {
echo "Can't get throughn";
} else {
echo "Socket opened!n";
fclose($ip);
}
</CODE>

To try and open a socket to the ECHO service (i.e., the ping port?) but that always fails.

How To Ping An Address With PHP?
I want to make an app that takes a URL, pings it 5 times and returns the average. I am good with PHP, I am just not sure how I would go about 'pinging' an address.

If someone here has any advice, please let me know. I have searched these forums, looked at zend.com and hotscripts.com and have been unable to find code that does this (although I am sure someone has done it!).

PHP Ping Script
I was wanting to know if anybody could make me a PHP script that will ping a server... if its up, it will display "Server Online" or something.. if not, it will say "Server Offline".

To Ping Another Server ?
Is it possible to create a page, that allows a user to see the ping time from his machine, to another server?

Ping Function...
how to make a PING function working with socket() or fsockopen() function... or something like this... Is a predefined function 2 do this? I wanna know from my script what's the response from a host (in seconds....)

Port Ping?
I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

Ping Server From PHP
Can anyone has idea about how to write code to ping the web/application  server from PHP?. If server is down then we should able to send an email. I want this utility for web sites tracking.

Ping Comparisons
I would love to compare two servers (or more) and have my script decide which one is working best, then pass that to my video player so it knows which one to use. Pinging makes sense in this. However, the only way I see to do it is with the system command, and I can't figure out how to get a usable result from this instead of a printed output.

Besides continuing to mess with that, any other way to accomplish the same thing (mirror comparisons) would be nice. Or suggestions on a low priced, reliable, somewhat fast server to host these videos on, which would probably be better.

Webpage That Can Ping A Server...?
what i want to do is make a webpage for my gaming comunity that basicly will ping the 2 main gaming servers say every 30 mins to make sure there online and then will either send u to the appropiate page IE if it dont ping its offline.. if it does ping .. the sever is up and running... is this possible or not..? is the a script out there that does this??

Xmlrpc Ping Server In Php?
I am looking for a php implementation for xmlrpc ping server. Do you
have any idea where I can find one?

Using mod_pubsub I can have a very nice blogchatter style of xmlrpc
ping server, but it is in perl and my client's system admin has moved
away from perl.

What my client wants: a real-time listing of blogs most recently
updated (assuming here that these blogs ping my client's ping server
when they're updated) similar to weblogs.com.

PING Results On PHP Web Page!
Can someone show me sample code on how can I write a script that shows ping results on a web page.

Ping In Chrooted Apache
is there any way to check whether a host is up in php, other than
using exec('ping... ) ?
i am running apache in a chroot environment, so the www user has no
access to /sbin/ping.

Ping An Ip Address And A Port
I have an application server running my game server. Now, I want to know is there anyway to write some php code so i can ping an ip address and a port?

PING Php Linux Server?
Anyone know how i can ping from a linux server to a remote machine then echo the results to the screen?

Send Ping And Log Result To File
I want to have a php script which pings a host with ping 1.1.1.1 -t all the
time and it shoukld write these things to a logfile.

When it comes like "timout exceeded" it should write this only once to a
file. Because if timout is 2000 times I don't want to have timeout exceeded
200 times in a database.

But when ping times are coming they should be logged in a file with date and
time when the ping accured.

Is this possible? - if yes, how?

Ping Multiple Sites With Script
I'm trying to ping several websites in order to keep them alive. I have a simple script here that I use that works great for 1 website. but if I include another site, my script doesn't run. Is there a way I can run this script and have it open more than 1 site at a time?


<?php
ob_start();
include("http://mywebsite.com");
ob_end_clean();
?>

Simple Ping Tool - Display Each Line
I'm creating simple ping script that prompts a user for various
parameters.

However, I would like each line of the ping displayed as it
is received. Currently, the result isn't displayed until the ping is
finished.

<?php

$ping_ip_addr = $_GET['Host'];
$ping_count = $_GET['Count'];
$ping_size = $_GET['Size'];

$result = explode("
", `ping -c $ping_count -s $ping_size
$ping_ip_addr`);

print "<pre>";

foreach($result as $val) {
print "$val<br>";
}

print "</pre>";

?>

<font face="verdana" size="2"><form action="<?php echo
$_SERVER['PHP_SELF']; ?>" method="GET">
IP Address: <input type="text" name="Host" />
Count: <input type="text" name="Count" value="5" />
Size: <input type="text" name="Size" value="32" /?
<input type="submit" value="Ping Host" name="Submit" />
</form>

Is There A Way To Echo An Echo Command?
Is this possible ? for those of you who don't understand what am i trying to ask:

<?php echo '<?php echo "This is what i'm trying to do!"; ?>'; ?>

To Echo Or Not To Echo
Which is faster for the server to process:

HTML inside echo tags or outside of PHP altogether?

Echo To Php
I know it may seem odd, but is it possible to echo to php? I mean
neasting php within php?

example

<?php
$array_levels="[1][2][3]";
$my_array<?php echo $array_levels; ?>="hello world"
?>

It may seem stupid but would be powerful, wouldn't it?
How can I accomplish what I just did differently?

Echo Or Not To Echo?
I have a couple pages that have tables, whats best use echo to produce the
full table with the variables or is it best to just make the table in plain
html and use <?php echo ('$va'l); ?> when i need to see some value.

Example, I have tables like this:

Help With Echo
Hi,

Im trying to get a form to display using php

I have sonme code eg.

conditional code
if true then
echo ('<form
target="paypal"action="https://www.paypal.com/cgi-bin/webscr"
method="post">');
etc
etc

When I runn it I get Parse error: parse error, unexpected T_STRING in
C:Program FilesApache GroupApache2htdocsPagesmrwhois_sample.php on
line 24

Line 24 being the echo line

Echo
what is the diference between doing: echo 'something' or echo "something";

PHP In Echo
Is it possible to put PHP in an echo? If so, how would I?

Echo
I am either too tire to think or not seeing it.  I have a echo statement as follows:

echo "Flight request date: " . "$date = $flight['Dept Date']";  does not display as suppose to. I am missing something?

PHP In Echo
Is it possible to put PHP in a echo statement, so that i could, say have something like this:
echo('Hello you are visiting this page: <?php echo(PHP_SELF) ?>');

Or whatever?

Echo Within Echo
Essentially, I want to incorporate some captcha code that I have working elsewhere in a simple form element into some more complex php code.

Basically, I currently have:

content .='blah blah';
content .='blah blah';

echo $content
However, my captcha code is as follows:

<img src='captcha.php?f=<?php echo $f;?>'>
$f is declared earlier with the relevant randomisation code.

However, if i combine the above into:

content .='blah blah';
content .='blah blah';
content .='<img src='captcha.php?f=<?php echo $f;?>'>';

echo $content
The captcha image displays but it is always the same image - it does not randomise.

Echo...
I'm trying to create a php 404 file however I dont know the command to echo the file you are trying to access I tried Quote<?php echo $_SERVER['PHP_SELF']; ?> but that just echoed 404.php

Echo Before Value?
I was wondering if there's anyone to do the echo before saying what the echo of the value is.

<?php  echo $header; ?>
<?php $header= "test"; ?> 

Displays nothing, while doing that backward of course does since it reads the page top to bottom.

I'm splitting the pages into header and footer and want to header (title of the current page) to be like this so i can just start my pages off saying what the page is with the header= "blah blah blah"

Echo A URL
i want to run and if statement and if something is true then redirect the user to another page.

How To Use Echo-php In The Html
please some one help. I want to pass the variables neatly in the below coloured boxes... how do I execute such using echo function.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="776" border="1">
<tr>
<td width="197">Name</td>
<td width="563" bgcolor="#00FFFF">&nbsp;</td>
</tr>
<tr>
<td>Address</td>
<td bgcolor="#006699">&nbsp;</td>
</tr>
<tr>
<td>Comments</td>
<td bgcolor="#00CCFF">&nbsp;</td>
</tr>
<tr>
<td>Delivery</td>
<td bgcolor="#006699">&nbsp;</td>
</tr>
<tr>
<td>Meals</td>
<td bgcolor="#00FFCC">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#006699">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#00CCFF">&nbsp;</td>
</tr>
</table>
</body>
</html>

Echo Certain Values Only
I'm creating a table that has 7 columns. In the first column, I'd like to show My_SQL data. The data contains multiple fields, but there is one that matters most right now.

Right now, I show this data with:

<?php echo $row_UserData['Number'];?>

However, I only want to echo this value if another value of the same row ($row_UserData['Code']) equals a certain number.

How would I write a conditional statement like this?

How Is Echo Implemented In Php
When used with the command line interface, echo writes to the stdout,
whereas in a Web environment, it writes to the response stream. How is
it implemented inside PHP?

Does it write to a stream?

Target For Echo
is that possible to assign a target for echo? I have this when i submit a form. PHP Code:

Varchar Col, Cannot Echo It All
I am in debug mode. And echo values passed from a query to another page
For example: $sub_cate_title= mysql_result($result,$i,"sub_cate_title");
The value is made out of two words like aaa (there is a space between) and bbb
Instead of echoing aaa bbb I only get the first part aaa. However the data is fully entered in the DB.

Echo Problems
i am just modding a scipt and i cant seem to get a function to work. PHP Code:

No Echo After Include?
<?php
echo "bbb";
include("common/funcs.php");
echo "a";
?>

When accessing the above test code from a browser it prings 'bbba.'
When accessing the page from a MFC app, it just prints 'bbb.'
Everying print or echo statement after the include gets ignored. Why
would this be?

Echo Vs Print
What's the difference between Echo and Print?

Why Won't Variable Echo?
Just moved web hosts and noticed that this:

<?php echo "$f"; ?>

used to work when there was an ?f= in the URL like so:
http://www.mydomain.com/index.html?f=yes

Now it doesn't at the new host.

I want to echo out "yes" in the HTML.

Echo And Print()
I'm wondering about the differences (if any) between echo and print(). The PHP Manual tells me that echo is a language construct and not a function so therefore it doesn't need parenthesis to encapsulate it's arguement(s), however I often use print() without parenthesis as well.

Does anyone know of any significant differences between these two functions/constructs and the ideal application for both? Up until now I have always used print().

Maths In Echo?
echo "<a href="content.php?categ=$categ&lower=[j]*5">$id[j]</a>";

The echo above is in a while loop, what is the best way of getting the lower variable in the link to be equal to 5 times the value of j (the number that increments by 1 each time the while loop runs through). Obviously [j]*5 will not work, so just wondering what will?

Print Vs. Echo
How echo command is differne from print command in PHP?

Echo Statements
I'm trying to change the user password - how? First, the user enters his old password, enter the new password twice. If the old password does'nt match with that of in the table, displays an error message.If the new password entered twice is not the same, also displays an error message.

If the old password matches with that of in the table and the new password entered twice is same, then the password is updated.MY CODE ALSO WORKS ABSOLUTELY FINE!!!! But, I've problems in displaying these error messages - Like,

1.If the old password does'nt match with that of in the table,and the newpassword which is entered twice is same, it has to display an error message "Old password is wrong"
2.If the entered old password matches with that of in the table, and the new password which is entered twice does'nt matches, then it has to display an error message "New password does'nt match"

3.If everything goes well, it has to display "Password updated successfully" PHP Code:

Echo Vs. Print
I'm new to PHP and am curios if there is any functional difference between a "print" and an "echo".

Add Href= Tag To Echo
Is it possible to add a "href=" tag to an echo line.

Something like this:
echo "<b>$name</b>,<br>Sorry there's a problem sending your message. Please
try <a href="/mail.html">again</a>";

Echo VARIABLES
I have a mysql query that grabs data from the table ... the data is
"variable names" something like $home $about $contact

I need the loop to echo those variables as PHP Code, so that they are
replaced with the variable value and not the variable name.

any quick function for that?

Echo A String That Contain <? And <?php
How can I echo a string that contain <? and <?php?

For example,

$str="test <? and <?php echo";
echo $str;

What I get is: test instead of: test <? and <?php echo



Copyright © 2005-08 www.BigResource.com, All rights reserved