Missing PHP/HTML/AJAX code for webcam image display

I have a webcam that uploads images with random names every 3 seconds. I need 3 things:

1) Find second newest image (not newest as sometimes this isn't fully uploaded when it is fetched). This then must be updated every 3 seconds while website is open - without web page refreshing, only image. Timestamp showing date and time image was created in GMT to be included under image.

2) Create looping animation of previous 60 newest JPG images (from oldest to newest) at a speed of 3 images per second

3) Display 60 newest images from oldest to newest in a list . Timestamp showing date and time image was created in GMT to be included under each image.

Code to help:

I have used this PHP to find the newest image - but not the second newest image:


$base_url = 'page/images';

$newest_mtime = 0;

$show_file = 'page/images/[login to view URL]';

if ($handle = opendir($base_url)) {

while (false !== ($latestFile = readdir($handle))) {

if (($latestFile != '.') && ($latestFile != '..') && ($latestFile != '.htaccess')) {

$mtime = filemtime("$base_url/$latestFile");

if ($mtime > $newest_mtime) {

$newest_mtime = $mtime;

$show_file = "page/images/$latestFile";





echo '<img src="' .$show_file. '" alt="Latest from the web">';


Also I made this loop when the image was always update with the same name, this doesn't;t work now that images have random names:




<td align=”center”><img src=”[login to view URL] alt=”Image will refresh every 0 Minutes 5 Seconds” width=”640″ height=”480″ name=”tcimage0″ border=”1″ /></td>



<td>This is my webcam…</td>




<script type=”text/javascript” language=”JavaScript”>// <![CDATA[

var tcimages = new Array();

tcimages[0] = “[login to view URL]”;

interval = 5000;

function Refresh() {

for (i=0; i<=0; i++) { tmp = new Date(); tmp = “?” + [login to view URL](); [login to view URL][“tcimage” + i].src = tcimages[i] + tmp; } setTimeout(“Refresh()”, interval); } Refresh();

// ]]></script>



Skills: AJAX, HTML, HTML5, Javascript, PHP

See more: ajax image upload jquery php example, display image using ajax php, html5 capture image from camera, php html ajax css, php html ajax page, dropdown display image php mysql ajax, display paging javascript ajax php html page, display barcodenumber image page php html, php html ajax, php mysql ajax html css, form fix page code php html, code project site design php html, multiple file upload php html ajax, php code webcam, php mysql ajax survey code questionnaire

About the Employer:
( 0 reviews ) United Kingdom

Project ID: #17213784

6 freelancers are bidding on average $50 for this job


Hello I have understood the requirements, and ready to work on this. I will work on it today and have it done asap. Let's get started! Thanks!

$35 USD in 1 day
(206 Reviews)

I am a Vietnam based Freelancer offering exceptional quality work for my clients from last 10 years. Please leave a message to review my samples.

$25 USD in 1 day
(209 Reviews)

Project Description I have a webcam that uploads images with random names every 3 seconds. I need 3 things:

$30 USD in 1 day
(57 Reviews)

I know my bid is over, much over your budget, but I know the work which it implicates, so this is my bid, I know perfectly how to help you if you AR interested, please let me know,. I'm Software Engineer expert in web More

$111 USD in 10 days
(33 Reviews)

Greetings, I was thinking of doing this in Node.JS in order to be able to send the real-time updated frames to the browser via websockets but if you prefer it's totally possible with a PHP back-end being polled by the More

$70 USD in 1 day
(3 Reviews)

Dear Sir, I would like to discuss few thing for better understanding of [login to view URL] share details and ping me for further discussion. Spare a moment on our previous work [login to view URL] http://profeenlinea. More

$30 USD in 1 day
(3 Reviews)