PDA

View Full Version : Random Image and Hosting



P0RYG0N
10th March 2006, 06:17 PM
Trying to pull off a random image generator something like the ones explained on these pages I found:
http://www.scriptarchive.com/rand_image.html
http://www.davelozinski.com/scripts/random_image/index.php?1141198201265#download2

I want to get a random image to use for things like forum sigs, etc. so it would have to be at one stable. No javascript or anything. I tried pulling off some of the codes on the sites I looked at, but either:
A)Host dosen't accept PHP codes
B)I'm doing it wrong. :\
I tired using a free host called awardspace.com that said they were compatable with php, but I couldn't get the random image stuff working correctly.
So if anyone knows of any good hosts to try this on (free, if any) and maybe some experience with something like this (it seems simple enough, but maybe I'm missing something) I'd be thankful.

Lady Vulpix
11th March 2006, 08:13 AM
As far as I can see, the code on the 1st link is written in Perl, not PHP. And the second one is for use within a web page, not between [img] tags on a message board.

P0RYG0N
11th March 2006, 10:22 PM
Well, regardless of it being php or not- I want any method of random off-site images on a free host. If anyone knows of any way to do that...

Sceptile_Master
12th March 2006, 07:16 PM
Award space is good. I have some PHP scripts running with them. Yeah there good, I'd stick with them. But for the script. Currently my web design doesn't go past (x)html, css and javascript. Can't help you there.

mr_pikachu
13th March 2006, 02:44 PM
Hmm... I'm not too familiar with PHP, myself. However, I found a script here (http://www.tecnorama.org/document.php?id_doc=57) that might help you. If that isn't what you need, then I'd recommend running a Google search and just sifting through the results.

youdontknowme
15th March 2006, 09:29 PM
And the second one is for use within a web page, not between [img] tags on a message board.

It still works. ;) I guess it depends on the forum board, but for the most part, it works. (It works in vB too)

http://www.davelozinski.com/scripts/random_image/random_image1.php.txt
That's from your second link. All you do is upload that script to your server then make an "images" directory and upload your images into that directory. And of course, make sure it has .php extension, not .txt.

So your directory tree should be like:
/
random_image.php
/images

/images
picture1.jpeg
pikachu.jpg
etc.gif
(btw, your images can only be .jpg, .jpeg, and .gif)

and then you add it to your sig:
[ img ]http://yoursite.com/random_image.php[ /img ]

If it doesn't work, try changing this line in the script: $IMAGE_DIRECTORY = "../images/";
to: $IMAGE_DIRECTORY = "./images/"; (remove first period)

Good luck!