...

View Full Version : Most recent Image



Jebadia
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.


I am not sure if this is a HTML or Javascript question so that is why it is here in the General forum. If anyone feels it needs to be move then by all means, move it.

Thanks in advance.

J

ionsurge
12-05-2002, 07:07 PM
That will be server side... not client side. ;)


Ionsurge.

Jebadia
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?

J

ionsurge
12-05-2002, 07:34 PM
Only mods can do that, I am just a wannabe mod... :)



Ionsurge.

Ökii
12-06-2002, 12:21 PM
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?

Jebadia
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.

J

cg9com
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 ;)

Jebadia
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

<script language="Javascript">
<!--
function refreshCam(){
rfsh = new Date() ; rfsh = "?"+rfsh.getTime()
document.images["webcam"].src = "webcam.jpg"+rfsh
setTimeout("refreshCam()", 5000)
}
//-->
</script>
</head>
<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>
<script language="JavaScript">
<!--
if( document.images )
refreshCam();
//-->
</script>

Thanks for the assistance, it is very much appreciated.

J

meerkat
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…

meerkat

cg9com
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 ...

Jebadia
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.

J

cg9com
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?

Jebadia
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)

Thanks all.

J

cg9com
12-06-2002, 07:33 PM
which language do you support?

Jebadia
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.

J



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum