View Full Version : Most recent Image
12-05-2002, 06:46 PM
First off let me say hello.
My question is; Does anyone know of a way to display the most recent image in a certain folder? So if a new image is uploaded it will be displayed instead of the older image.
Thanks in advance.
12-05-2002, 07:07 PM
That will be server side... not client side. ;)
12-05-2002, 07:26 PM
Thanks for the response.
Is there any way to move this topic to the ASP/JSP/PHP forum then?
12-05-2002, 07:34 PM
Only mods can do that, I am just a wannabe mod... :)
Plus you'd be wanting to tell us "exactly" which serverside language (and possibly version thereof) that your host supports.
No point telling you how to do it in PHP or Perl if you can only use ASP is there?
12-06-2002, 02:57 PM
They allow all of the above but since I see you are Mr. PHP that would probably be easiest. Thanks for your reply, I really do appreciate it.
12-06-2002, 03:41 PM
what exactly do you mean display newest image?
were is the image being displayed at?
can you elaborate?
btw the mods will move the threads whether you tell them to or not ;)
12-06-2002, 05:09 PM
Basically, I want the code to look for the most recent image in a certain folder (the same folder that contains the page) then display the image on a webpage. So when a new image is uploaded to that folder the code will then display the the new image till a new one is uploaded ... ect ...ect... and so on and so forth.
I am trying to get away from just being able to display an image with a specified file name while refreshing the page with a Java script. See below
rfsh = new Date() ; rfsh = "?"+rfsh.getTime()
document.images["webcam"].src = "webcam.jpg"+rfsh
<body bgcolor="#FFFFFF" text="#080000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<b><font size="3" face="Arial"><p align="center">WebCam Page</p></font></b>
<center><img src="webcam.jpg" name="webcam" width="352" height="288" border="0" alt="Finish Him!!!!!"></center>
if( document.images )
Thanks for the assistance, it is very much appreciated.
12-06-2002, 05:23 PM
You're obviously going to have to upload the 'new' image to the folder and where you to call all these images 'webcam.jpg' then surely when you upload the new 'webcam.jpg' it'll overwrite the existing image?
Or am I missing something here…
12-06-2002, 05:35 PM
so basically, you have an image displayed, and you are uploading another image manually? and you just want the page to display the newest image? are you wanting the image the update itself?
i think im thinking the same thing meerkat is, why dont you just manually edit the markup ... otherwise if you relpace an image that has the same name, the next time the page is loaded then the new image will show ...
12-06-2002, 05:37 PM
That is correct but I want to get away from doing that.
There is a possibility that the image being uploaded will not have the file name webcam.jpg it could be webcam234234.jpg or something else and so I want that new image to be displayed instead. Thanks for your replies.
12-06-2002, 05:51 PM
but are you uploading them yourself? or is it being done manually by anyone? if thats the case the editing the markup would be the easiest way, there are other ways to accomplish this, but it would require alot more effort
im assuming you are looking for a script to dynamically write to the page?
12-06-2002, 06:06 PM
No the upload will be automatic on an action from the webcam. The image will be uploaded with a time stamp in the file name, which, obviously, will change depending on the time uploaded.
That is why I want the most recent image to be selected then displayed. Since the file name will not ever be the same the easiest way to do it (i belive) would be to select the most recent image in the folder. I now know this will take more than some simple HTML or Java script (ionsurge) and will in fact need to be server side coding. (PHP ASP JSP...) (Okii)
12-06-2002, 07:33 PM
which language do you support?
12-06-2002, 08:12 PM
If support= know then zero, I am a straight HTML kinda guy. None of that fancy stuff for me. That is why I came here.
If by support you mean; which does my Host suport?-- then Perl, PHP and ASP.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.