random image script?
Anyone have a random image script that can also check the domain?
Basically I have a few websites that all point to the same content.
I am after a random image script, that will see what domain is in the address bar, and display a random pic from a folder.
So come in from domain1.com, and you will get a random pic from /images/domain1/
domain2.com random pic from /images/domain2/
etc...
anyone know of one?
Basically I have a few websites that all point to the same content.
I am after a random image script, that will see what domain is in the address bar, and display a random pic from a folder.
So come in from domain1.com, and you will get a random pic from /images/domain1/
domain2.com random pic from /images/domain2/
etc...
anyone know of one?
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
you need to check the 'referrer' header iirc.
It would be very easy to do if, you had a list of the images stored in a db, or stored the images in a db
David
It would be very easy to do if, you had a list of the images stored in a db, or stored the images in a db
David
or stored the images in a db
Just store the locations, but a database is overkill.HTTP_REFERER is client supplied, so you can't guarantee it will even be there. You should be able to get it the proper way using your CGI libraries.
Trending Topics
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
depends how many file names you have really as to how bigger an array you want to use, hence my suggestion for a db.
You may even be able to do a for each file in folder and then refer to each file with an index, then query the index/object for file.name?
I didnt mean using a 'blob' I did mean just storing the path, just didnt word it like that!.
David
You may even be able to do a for each file in folder and then refer to each file with an index, then query the index/object for file.name?
I didnt mean using a 'blob' I did mean just storing the path, just didnt word it like that!.
David
I have a php script that you call as an img tag, and it displays random photos in that folder.
I guess I could create multi folders, and put the php script in each folder. Put some code in the html that will see the address in the address bar, and then pull the php script from that domains folder.
I guess I could create multi folders, and put the php script in each folder. Put some code in the html that will see the address in the address bar, and then pull the php script from that domains folder.
Thread
Thread Starter
Forum
Replies
Last Post
hardcoreimpreza
Computer & Technology Related
21
Oct 11, 2015 03:40 PM





