My Web Cam Example

- Image Uploaded: April 20 2009 13:11:55 ADT -

Here's the source code for this Sample:


<html> <head> <title>Sample Web Cam</title> </head> <body> <!-- Start of PHP code --> <?php $filename = 'drive61.jpg'; if (file_exists($filename)) { // use TZ only if your server uses GMT time putenv("TZ=America/Anchorage"); echo "<center><font size=\"6\">My Web Cam Example"; echo "</font></center><br>"; echo "<table align=\"center\" border =\"2\"><TR>"; // Make a table cell and put the image in the background echo "<TD border= \"2\" width= \"640\" align= \"center\"; height= \"480 \" "; echo "background = \"$filename\" valign= \"top\"<b>"; echo "<span style=\"background-color: #FFFFFF\">"; // Now lets print the timestamp in the table cell echo "<font size=\"3\">- Image Uploaded: " . date ("F d Y H:i:s", filemtime($filename)); echo " ADT -</font></center></td></tr></table>"; clearstatcache(); } ?> <!-- End of PHP code --> </body> </html> Of course, file extension must be .PHP for this to work!

The drawback to this method is that the image is actually the background of the cell, so if you decide that you want to print it, you have to turn on 'print background' in the browser options.

To save the image, right click over the image and select 'save background'.