Hey everyone, I have a huge favour to ask and I am hoping someone out there knows a few tricks =) I've got a few days off and I am busy working on the Polycount stuff. One of the new features is our headers will be rolling. (Heads will roll! Ha!). Anyway, the artwork for the headers will be of artwork by you guys (more on…
Sonic, yours is doing the same as Pauls and just displaying the word "polycount" and linking to the main page of the forums. Tried changing $path = getcwd() . to the folder its in (/headers, not /banners) and that didn't solve it either.
Looks like your original code contained a more catch-all method of scanning a folder for images of various types, with a more flexible naming convention. Might wanna use that in conjunction with my oh-so-simple "echo" :)
That PHP should be in a root directory with a subdirectory named "banners." Maybe the folder tree is funky? Or maybe you need to modify the echo code for where you are putting it? The code I made displays this and this only:<img src='banners/RANDOMBANNER.jpg'> I just tested it out on my server and it works fine :(
EDIT: now it works! Also, I want to add that a few of those variables can easily be cut down but I put them in there for the sake of it being easier to read. EDIT2: Also, you will never have to generate a list of images or do anything. Just drop any image at all in the folder and it'll be added :)
What would I do to that code to have it not-make a new image each time, but rather use one of the existing gifs in that folder? Rick is correct, him and I tried 3 different php files and 2 had the same result, the other would only generate a new image on a hard-refresh of the page (F5, not hitting the refresh button). So…
I'm guessing you don't need image file checking because all of the files in the folder will be images. This will generate a truly random image each time and will also allow the browser to cache the image. <?$path = getcwd() . "/banners";$dir_handle = @opendir($path) or die("Unable to open $path");$banner_no = 0;while…