cursed Posted December 17, 2006 Share Posted December 17, 2006 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 More sharing options...
trq Posted December 17, 2006 Share Posted December 17, 2006 [code=php:0]if (strpos(@file_get_contents(' http://www.svyt.com/proxy.html'), 'advanced') !== false)[/code] Link to comment https://forums.phpfreaks.com/topic/30943-solved-onlineoffline-script-help/#findComment-142774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.