-
March 23rd, 2004, 07:29 PM
#1
Image Rotator
okay, just wondering if anyone knows of a script or something to rotate an image on a website. I know there are lots out there, but I need one that rotates a link for the picture. I want each time someone accesses the link (www.mypage.com/mypic.jpg for example) I want it to display a different picture.
I know there are lots of javascripts etc. that will rotate the image on a page, but thats not what I want
any help or suggestions would be greatly appreicated
Never let the facts get in the way of a carefully thought out bad idea!
-
March 23rd, 2004, 07:45 PM
#2
Registered User
can you sue php? I have some code already to do this, its very ez
PHP Code:
<? //Set random engine srand((double)microtime()*1000000); //Set what to make random $random_img = array("<img src=\"img1.jpg\" alt=\"this is image 1\" border=\"0\">", "<img src=\"img2.jpg\" alt=\"this is image 2\" border=\"0\">", "<img src=\"img3.jpg\" alt=\"this is image 3\" border=\"0\">", "<img src=\"img4.jpg\" alt=\"this is image 4\" border=\"0\">", "<img src=\"img5.jpg\" alt=\"this is image 5\" border=\"0\">"); //Calc the random images srand(time()); $sizeof = count($random_img); $random = (rand()%$sizeof); //Display Random Image echo $random_img[$random]; ?>
Last edited by +Daemon+; March 23rd, 2004 at 07:50 PM.
-
March 23rd, 2004, 07:50 PM
#3
yah I can use php code, just as long as when someone clicks on the link to the picture (a link not on my page) it loads a different picture
Never let the facts get in the way of a carefully thought out bad idea!
-
March 23rd, 2004, 07:54 PM
#4
I don't think that will work, it just rotates pictures on a page
I have webspace, but I need to link to a bunch of pictures from another website, so when someoen loads the image www.mypage.com/mypic.jpg or whatever the link is, I want it to display a different picture
Never let the facts get in the way of a carefully thought out bad idea!
-
March 23rd, 2004, 08:05 PM
#5
Registered User
oooh like a angelfire thing
-
March 23rd, 2004, 08:08 PM
#6
Registered User
-
March 23rd, 2004, 08:19 PM
#7
Originally Posted by +Daemon+
Um, maybe, I could be wrong, but isnt' that script just to prevent people from linking to your picture on your website?? The Thing is I Want people to link to a certain picture on my site, but everytime they load that link a different picture will appear. The way this other site is set up is it will only allow a link to a picture (.jpg, .gif), and it was originally only designed to link to one picture, but I want it to rotate the image. So when it loads www.mysite.com/picture.jpg like it normally does, I want the picture ot be different each time
I know this sounds confusing, but I think it should be able to be done, I'm hosting the images off a good host, not just geocites or whatever if free
Never let the facts get in the way of a carefully thought out bad idea!
-
March 23rd, 2004, 08:21 PM
#8
Registered User
so like a javascript image click rotation, but have the link the same?
somthing in the means of
http://www.codebelly.com/javascript/...gechange.html#
-
March 23rd, 2004, 08:33 PM
#9
Originally Posted by +Daemon+
Sorry, I know my request is really confusing, and I suck at explaining
This is sorta what I want to do (same idea)
It would sorta be the same as having an avatar for a messageboard, in the messageboard you specify the address for your avator (www.mysite.com/avatar.jpg), normally it would display the same pic everytime. My goal is to have a directory of images hosted off my website, that would display a new picture each time the messageboard loads the avatar from the location you specify, instead of the same picture each time.
This might be impossible, but I sorta think it can be done
Never let the facts get in the way of a carefully thought out bad idea!
-
March 24th, 2004, 10:27 AM
#10
Registered User
you would have to use that php random code and set the server extitions to use jpg as a php file then put in that code and have it open a random image and them rewrite the image and spit it out. So the avatar.jpg looks like a image file but its really a big php file named as a jpg... get it ?
kinda like this (the image create part)
http://daemonprojects.com/imgcreate/go.php
note it refreshes to the image, thats because im lazy and didnt setup my apache.conf file to use jpg files as a page.
-
March 24th, 2004, 03:40 PM
#11
Originally Posted by +Daemon+
you would have to use that php random code and set the server extitions to use jpg as a php file then put in that code and have it open a random image and them rewrite the image and spit it out. So the avatar.jpg looks like a image file but its really a big php file named as a jpg... get it ?
kinda like this (the image create part)
http://daemonprojects.com/imgcreate/go.php
note it refreshes to the image, thats because im lazy and didnt setup my apache.conf file to use jpg files as a page.
Cool, thanks Daemon, you've been a ton of help
Never let the facts get in the way of a carefully thought out bad idea!
Similar Threads
-
By Archangel42069 in forum Tech-To-Tech
Replies: 26
Last Post: April 25th, 2003, 11:16 PM
-
By TheCardMan in forum Tech-To-Tech
Replies: 2
Last Post: December 29th, 2002, 09:29 PM
-
By nechronius in forum Windows NT/2000
Replies: 4
Last Post: October 12th, 2001, 05:34 PM
-
By PitaBred in forum Tech-To-Tech
Replies: 3
Last Post: May 30th, 2001, 06:56 AM
-
By quinn1981 in forum CD-ROM/CDR(-W)/DVD Drivers
Replies: 1
Last Post: August 3rd, 2000, 05:03 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks