By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

Need help with WebCam page, understanding scripts?

P: 1
Hi, new kid on the block... Hope I am posting this in the proper forum as it involves HTML, JAVA as well as PHP.

A little background... I have been writing PC apps using Borland's C++ Builder for many years and have written a couple WebCam utilities for my model airplane club. My utilities handle all the tasks of acquiring the images, FTPing them to the web site and handling via FTP image renaming replacing etc. What I don't know what I am doing with is the HTML/JAVA/PHP stuff that needs to be on the web site.

I barley managed to get the site working using scripts I found on the net.. Trial and error resulted in the web page at Mostly JAVA scripts to refresh the image and run the count-down timer. It also contains a time-out script as the bandwidth of the club site is somewhat limited and I didn't want anyone falling asleep and letting it download images forever.

You would not believe how many times I broke the webcam page trying to make it do what it does now. Even though it's working I'm still not positive it's exactly right.

Anyway, I found a PHP script on-line at . I would like to incorporate into the web site but don't really understand enough about any of it to be able to make it work. PHP code makes more sense to me than JAVA code but it's still greek because I don't understand the basics of any of it.

Anyone out there that might take the time to look at my webcam.html source and give me a few pointers on what would be needed to incorporate the cavemonkey PHP code into it?

Dec 14 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 5,821
Heya, Bob. Welcome to TSDN!

The webcam script you found is probably more power than you really need.

More or less, what you have is perfect. Simply reload Webcam.jpg once every 60 seconds, with a cache buster built into the URL (that's why you have these lines in your script:

Expand|Select|Wrap|Line Numbers
  1. tmp = new Date();
  2. tmp = "?" + tmp.getTime();
  3. document["gimage0"].src=  gimage + tmp;
though there is a better way to write that, but that's a topic for another day... :P).

The only real advantage to using the webcam script is so that you can display an alternate image if the webcam image hasn't changed in the last 60 seconds. Useful for determining if the webcam is down.
Dec 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.