Author |
Topic |
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 03 August 2001 : 19:23:00
|
I would like to show a random image from a folder. Easy? Yeah, I know how to show a random image everytime the page loads, but how about for the entire day? For example, this is for a gaming site and it is going to be used for enviorment in the game. So if its rainy it should be rainy all day and perhaos twice in a roll. However, all scripts I find will make the image random on every page load. Anybody have an idea???
******************** Who is this General Fault, and why is he reading my Hard Drive??? |
|
Id
Junior Member
USA
129 Posts |
Posted - 03 August 2001 : 20:12:27
|
you'd have to modify the global.asa file for it to work, and store some things in application variables. I'm not sure exactly what would need done with the code, but you'd need a variable that would store the date, and then you'd need to run a check against the date to see if a new image needs to be created.
Going insane one day at a time |
|
|
Spoon
Average Member
Ireland
507 Posts |
Posted - 04 August 2001 : 08:16:03
|
quote:
you'd have to modify the global.asa file for it to work, and store some things in application variables. I'm not sure exactly what would need done with the code, but you'd need a variable that would store the date, and then you'd need to run a check against the date to see if a new image needs to be created.
Going insane one day at a time
Hi,
In theory, you could add a table to a databases and call it Image_date or something. Have two fields. Picture and Today_date. Now write some code to check the database and see if the actual date matches the date in the database field "TODAY_DATE". If it does, then read the field Picture and display the image. Then use an application variable so you dont have to connect to the database every time a user accesses the page.
Of course, if the actual date doesnt match the date in the database then write the new date to the database, use your random image picker script to pick the new image, then write that image url to the db. Then use your application variables again.
That should work...
Regards - Spoon
Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html
www.ASlickPage.com - Private Messaging |
|
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 04 August 2001 : 20:54:01
|
WHOA! Let me read that a few more times.....
Thanks! I have to start playing around with it :)
******************** Who is this General Fault, and why is he reading my Hard Drive??? |
|
|
Spoon
Average Member
Ireland
507 Posts |
Posted - 05 August 2001 : 09:34:04
|
quote:
WHOA! Let me read that a few more times.....
Thanks! I have to start playing around with it :)
******************** Who is this General Fault, and why is he reading my Hard Drive???
If you need any more help let me know...
Regards - Spoon
Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html
www.ASlickPage.com - Private Messaging |
|
|
|
Topic |
|