I have searched everywhere and cannot seem to find any scripts that work to do what i need it to do.

Ok i have a webcam viewing outside etc. Well i have the webcam image being hosted on my computer at home. Now the computer is on a schedule to shut down at 10:30 PM and start up at 5:30AM. Now i host the html file to view the webcam on my website being hosted by godaddy, a whole other server hosting my website. I'm trying to get it where the programs doesn't have to constantly login into the ftp and upload a new image every minute. Now also during the downtime i would like a page automatically to display webcam down, (i'll make the webcam page, i'll i need is a script)

Well i need a script that checks whether my computer web-server is down and to display the webcam down page and when it's up to display the webcam up page.

Overall the same theory of seeing if a website server is down or if it is up, only i need to get it where it displays a webpage to it's current state. I hope you know what i'm trying to get at. I tested url_exists scripts, url_check scripts, etc.

Please Please Please, i need anyones help on this.

    Perhaps also, a quick
    ipconfig /release
    ipconfig /renew
    exit

      Webcams are not my forte, but perhaps a quick:

      ipconfig /release
      ipconfig /renew

      might be of help.

      You can issue this through a batch file , check the results, and do what you want as a result.

      Just hoping....

        I got it to work. Had to make my own script,

        Well luckily i took a java class and this was the first script i made barley knowing anything what to do.

        But overall the script uses if(fopen()) which if that equals true it loads a html page.

        And if it's false i use a else { <html> to load the webcam down page.

        i'll post the script later but the only problem is timeout. I had to reset my default time out settings in php.ini to 5 seconds so it didn't take all day to load the script. Now that i see how fun php is, i might actually buy or go to a class to learn it. 🆒

        Oh ya, fsockopen works to a degree. See it opens a socket in my internet connection which is always running but it doesn't access my computer to see if it is running and it always gives a true statement where fopen actually opens up my home computers test webpage and if it can't open it, puts out a false only time out is the problem. You just have to modify the php.ini settings to get it to work.

          I'm pretty sure you can set the timeout at runtime using ini_set or whatever the function is. This way, it doesnt affect other scripts as well.

            2 years later

            This is an extremely ancient thread but it still pops up in Google so it may still have a few eyes yet. =)

            I would have had the script simply look at the timestamp of the uploaded image. If X amount of time has passed since the last upload, then display the desired page stating the server is currently down.

            Maybe not as fun this way but certainly less cumbersome and portable as most of us have dynamic IP's at home.

            Cheers!

              Write a Reply...