[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 09-17-2005, 11:05 AM   #1 (permalink)
NamePros Regular
 
edmarriner's Avatar
 
Join Date: Apr 2005
Location: England :D
Posts: 838
78.15 NP$ (Donate)

edmarriner is a jewel in the roughedmarriner is a jewel in the roughedmarriner is a jewel in the rough


ping a url

is there anyway or waebist to basicly ping the url say every 30 mins?

thanks

ed
__________________
Leeds united football club


edmarriner is offline  
Old 09-17-2005, 11:53 AM   #2 (permalink)
Senior Member
 
Shorty's Avatar
 
Join Date: Sep 2005
Location: England
Posts: 1,035
102.05 NP$ (Donate)

Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice


You mean non manually? No idea. You can just type ping http://www.sitename.com every 30 mins...
Shorty is offline  
Old 09-17-2005, 12:40 PM   #3 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
 
Join Date: Aug 2004
Posts: 3,794
47.60 NP$ (Donate)

stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of


Hey Ed,

Here's what we'll do. Assuming you have access to the ever ample PHP, crontabs and access to shell_exec(), we'll begin.

The following is a script that will run the ping, and return a result.
PHP Code:
<?php
/*
Script written by Steve Castle (http://www.stscac.com)
Modified from http://shat.net/php/nqt/nqt.php.txt

For the purpose of this example, the filename of this file (PHP_SELF) will be named ping.php and located in server path erver/path/to/script/

The "$domain" variable is the domain name you are going to be checking.  Use  the domain name without the protocol.
(Good = namepros.com, Bad = http://www.namepros.com)
*/
$domain = "namepros.com";
function
message($msg){
echo
"<font face=\"verdana,arial\" size=1>$msg</font>";
flush();
}
function
ping($domain){
message("<p><b>Ping Results:</b><blockquote>");
if (!
$msg .= trim(nl2br(`ping -c5 '$domain'`))) #bugfix
  
$msg .= "Ping failed. Host may not be active.";
$msg .= "</blockquote></p>";
message($msg);
}
ping($domain);
?>
The following is the crontab that needs to be added to your server, so the PHP script above can be run every 1/2 hour.
Code:
30 * * * * server/path/to/script/ping.php
This only checks the results every 30 minutes. To report the results, you would have to email them or add them to a database.

Hope this starts you off in the right direction.

Cheers !

-Steve
stscac is offline  
Old 09-17-2005, 12:43 PM   #4 (permalink)
Senior Member
 
dgaussin's Avatar
 
Join Date: May 2004
Location: France
Posts: 1,294
85.60 NP$ (Donate)

dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold


You could try http://www.host-tracker.com
dgaussin is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Short URL Redirect Service!! iceman35 For Sale / Advertising Board 3 09-16-2005 06:41 AM
soooo many yahoo's redhippo Domain Name Discussion 5 07-12-2005 11:26 PM
masking download url -Ray- Programming 4 06-29-2005 06:17 AM
Free URL Redirection LeKiz Free Resources 0 03-30-2005 11:00 AM
Add your url to my site for free. gemsergio For Sale / Advertising Board 0 01-07-2004 09:23 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 04:57 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85