galexcd 0 Report post Posted October 15, 2005 Hi! I want a random image, do i need to set that up with your web host? Can i implement coad into my images?Thanks! Share this post Link to post Share on other sites
electriic ink 1 Report post Posted October 16, 2005 Here's an even smaller random image script but it requires php instead. Xisto has php so all your visitors will be able to use this. For this script each image needs to be called something1.png, something2.png, something3.png etc. You can change the text "something" and the image extension into something you choose but the number must remain in place. It is assumed that all your images are stored in the directory images/ but you can change that in the script. All your images must be stored in the same directory and all image extensions must be the same. <? // Selects a random number from 1 to 4. Change 4 to the amount of images you have $randomNumber = rand(1,4); // Displays the image echo "<img src=\"images/something" . $randomNumber . ".png\" alt=\"My random image\">";?> And that's it Share this post Link to post Share on other sites
galexcd 0 Report post Posted October 19, 2005 No, sorry should have clarified myself... i dont mean on the html page, i mean on the image itself... like a dynamic image...HOw do i add lines of coad to the acctual image itself... thanks! Share this post Link to post Share on other sites
pawitp 0 Report post Posted October 20, 2005 Adding codes on the image itself is impossible. Unless your a hacker and is attacking a security hole on images(It does exists). PHP can create dynamic pictures and Xisto has GD enable,hasn't it? Describe what you want and we can tell you other method of doing what you want! Share this post Link to post Share on other sites
galexcd 0 Report post Posted October 21, 2005 Ok, like how do they make those couters?Its one image like counter.jpg, but every time you refresh the image it automatically counts... is that php generating an image? and if so, why isn't it a php page i link to, instead of a jpg?Example here-------Another thing how do they make those random message board sig things, like i have one in my sig... its different every time, but its just a regular <img> tag... is that PHP generating the image? and if so, why isn't it a php page i link to, instead of a jpg?--Thanks! Share this post Link to post Share on other sites
pawitp 0 Report post Posted October 21, 2005 Maybe it's a virtual directory and the jpg extension is generated by PHP. But the virtual directory ends with a .php doesn't it?They maybe make php recognises the jpg extension and php will process every jpg file there! Share this post Link to post Share on other sites
galexcd 0 Report post Posted October 23, 2005 hmm not sure, but just look at the image in my sig... how does danasoft do it? its random, but it has a .jpg extention! Share this post Link to post Share on other sites
pawitp 0 Report post Posted October 25, 2005 I think Danasoft did it with php virtual directory and apache's mod-rewrite (I've just done the research on this and I'm not guranteeing it's right).The folder sig is a "real" directory but nothing exists in there except 2 files, "index.php" and ".htaccess". The content htaccess tells apache to forward all the files with a ".jpg" extension to the php file which process the files. Share this post Link to post Share on other sites
galexcd 0 Report post Posted October 27, 2005 ok... i see... i guess...Thanks for all your help! Share this post Link to post Share on other sites
younghero 0 Report post Posted October 27, 2005 yeah, so good .learning. Share this post Link to post Share on other sites