Choggo
(?)Community Member
- Report Post
- Posted: Tue, 13 Jul 2004 01:45:13 +0000
ok.. haven't checked for bugs, would appreciate on comments so I can work on them
Random image, and random link. the link corresponds to the image.

should be simple enough to modify so it works with image map...
this post itself is a test, it worked when I tested it.. but the image wasn't located anywhere sweatdrop
edit: one glitch I'm pretty sure of... if the image is loaded in two different pages... the last loaded will be the the one defining where the link heads to, because of the session variable it uses.
source codes:
Random Image
Random Link
how:
looks inside the folder images and gets total listing of images, picks a random one and displays it, png,jpg and gif only.
Assigns a session variable telling the number chosen
when clicked on, it reads all the files inside the folder urls and loads the one that corresponds to the image chosen (text file with the same name as picture) it reads the file, and redirects to the URL contained in it.
I did it this way, because I think it would be easier to add more images into the rotation. If you want to use image maps though, you'd have to hardcode em into the script, or work on the formatting for the text file to read and build an image map for each image.
Random image, and random link. the link corresponds to the image.

should be simple enough to modify so it works with image map...
this post itself is a test, it worked when I tested it.. but the image wasn't located anywhere sweatdrop
edit: one glitch I'm pretty sure of... if the image is loaded in two different pages... the last loaded will be the the one defining where the link heads to, because of the session variable it uses.
source codes:
Random Image
Random Link
how:
looks inside the folder images and gets total listing of images, picks a random one and displays it, png,jpg and gif only.
Assigns a session variable telling the number chosen
when clicked on, it reads all the files inside the folder urls and loads the one that corresponds to the image chosen (text file with the same name as picture) it reads the file, and redirects to the URL contained in it.
I did it this way, because I think it would be easier to add more images into the rotation. If you want to use image maps though, you'd have to hardcode em into the script, or work on the formatting for the text file to read and build an image map for each image.