Bookmark and Share Chat with us on Live Messenger Chat with us on Skype Follow iServices Facebook Profile of iServices MySpace Profile of iServices LinkedIn Profile of Jesse Grobstein LinkedIn Profile of Carla Narciso Login to i Services Private Server
Ninja Mascott We've arrived, and to prove it we're here

    Welcome to our blog!

    Bookmark this page and visit regularly to check for new content and free software recommendations!
    visit volcanoecigs.com for the best eCig starter kits and accessories on the web
« VBScript to copy/backup files...Free J&C phpGallery »

Check if remote server is online and include file.

04/01/09

Permalink 09:13:11 am by i Services, Inc., Categories: Scripts and Codes

This little PHP snippet will allow you to check if a remote web server is online and include a file from the remote server. Because PHP's include command does not seem to work with remote servers we have used the readfile command to replace it.

Code:
<?php
if(fsockopen("remoteserver.com"80$errno$errstr2)){
 @
readfile("http://remoteserver.com/path/filename.ext");
 } else {
 
// do something else if server is not available...
}
?>
A place for us to post information and keep our visitors informed.

User tools

Advertisements

Search

XML Feeds


blog soft



Home  |   Services  |   Portfolio  |   Our Blog  |   About Us  |   Contact Us

© Copyright 2006 - 2012. i Services, Inc. All rights reserved.