Jump to content

[SOLVED] Online/Offline script help?


cursed

Recommended Posts

I want a simple php script to show if a website is offline or online.. however, i dont want it to show [CODE]
Warning: file_get_contents( http://www.svyt.com/proxy.html) [function.file-get-contents]: failed to open stream: No such file or directory in /home/user/public_html/proxy/status.php on line 6
[/CODE]

I just want it to show:
[color=red]offline[/color]
heres my code:
[code=php:0]
<?php if(strpos(file_get_contents(' http://www.svyt.com/proxy.html'), 'advanced') !== false)
  echo('<font color="green">Online</font>');
else
  echo('<font color="red">Offline</font>'); ?>
[/code]

Note: svyt.com/proxy.html should contain the text advanced - no need to change any part of that.
Link to comment
https://forums.phpfreaks.com/topic/30943-solved-onlineoffline-script-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.