Jump to content

[SOLVED] Ping Multiple sites with script


ibda12u

Recommended Posts

Hello 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();
?>

 

 

Link to comment
Share on other sites

If you just need to hit some sites in order to keep it from inactivity, just do this:

 

<?php
$a = file_get_contents("http://yoursite1.com");
echo "Site#1 is " . strlen($a) . " bytes long.<BR><BR>";

$b = file_get_contents("http://yoursite2.com");
echo "Site#2 is " . strlen($b) . " bytes long.<BR><BR>";
?>

 

You get the point on how to do this for multiple websites...

Link to comment
Share on other sites

If you just need to hit some sites in order to keep it from inactivity, just do this:

 

<?php
$a = file_get_contents("http://yoursite1.com");
echo "Site#1 is " . strlen($a) . " bytes long.<BR><BR>";

$b = file_get_contents("http://yoursite2.com");
echo "Site#2 is " . strlen($b) . " bytes long.<BR><BR>";
?>

 

You get the point on how to do this for multiple websites...

 

That worked perfectly! Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.