Right well lets say i make about 10 banners for my site.. all with suttle differences.. and when the page loads i want one to load randomly so the user sees a veriaty of the images randomly... I know where the image is i want to replace and im assuming i replace that with a script of which contains the images i have.. If there isnt anything free available then i am willing to pay a resonable ammount. I Have a few features i want to be adding to my site (they are posted on DP) and i need to get these done ASAP. cheers people look faward to hearing off you.
There is absolutely no need to pay me (atleast) for this 2 minutes reply save following as random_mage.php save following as test_script.php Now upload, both files, and browe test_script.php I hope it helps. regards
IMPORTANT: When saving as php file in notepad, there must not be even a single character before <? and after ?> otherwise random_mage.php wont work correctly. And may result an error 'Header already sent'. regards
I have created the two pages and here is the code within them. random_image.php = test script = when the page is opened i get the little red box indicating an image error... any help appreciated. Note that is the whole pages code selected.
open the random_image.php directly and if possible please show me the link I can diagnose myself Also "http://www.xninelivesx.com/images/banner.gif", is the last entry which must no have a comma ',' at the end. regards
http://www.xninelivesx.com/1 the number on the end does alternate so im assuming works. but now i get a can not be displayed messege.
You definitely have left a blank character anywhere either before <? or after header("Location: $random_image"); ?> Which is resulting function header not being executed and header not being sent ot browser. Second cause may be the image url is not valid. Lets do it in one script: (include followng in your html page anywhere) in this script you do not need to worry about space characters. I was actualy trying ot provide you a more generic way. regards
Sorry My mistake in code, I was requesting numebr as image url Following code is 100% file, save it in file and run it regards
check it out... little red box indicating an image error.. http://www.xninelivesx.com/random_image.php << this works http://www.xninelivesx.com/test_script.php << Not so much this one thanks for ther perserverance guys.. i could do with a little more help on the subject.
The last version I provided does all the job itself, so there is no need of second script. http://www.xninelivesx.com/random_image.php is sufficient. You can add HTML code to it before <? and after ?> easily in notepad. regards
ok thats great..so i include that script on the pages i need yes?.. isnt there a way to use it like an include? im shit at php btw
You can use both. I have attached a file random_image.php, upload this one without modifying (IMPORTANT upload in BINARY mode not ASCII in your FTP program) Then put following code in your html page anywhere you wish to load random image without worrying about space characters or anything Besides, try checking in possible browsers like IE, FireFox, Opera, Safari etc. I hope you don't pull your hair now . regards
vooler so far you have been great and im glad to see your post count shoot up... but in my v-bullitin forum.. i wanrt it at the top.. any advice?
1) Go to admin control panel 2) Go to STYLES & TEMPLATES --> Style Manager 3) Select the desired template, then click the dropdown box then click EDIT TEMPLATES. 4) Edit the appropraite template. For under the navigation simply click NAVBAR and add the script to the bottom of the code.