For instance - http://www.fpsgaming.us/ascension_superjump.html I want the pic next to AdSense to be swapped out with different pics randomly. I did a search on here and found a php script, but I couldn't get it to work. PLEASE I need some help
Assuming you can use PHP... $my_urls = array( 'url1', 'url2', 'url3', ); $url2use = rand(0,count($my_urls)-1); PHP: Then in the HTML... <img src="<?php echo $my_urls[$url2use]; ?>" alt="" border="0" /> HTML: I use that for some other stuff and it should do the job for you.
Alright, I'm a n00b, so I need some more detailed help I want to test it out on the link up top, with the Halo 3 picture by AdSense. I set up a folder for rotation images (root/images/rotation) and it has 2 images in there. I know my server allows PHP, but I don't exactly know how to use it, so can you help me a little more please? Thanks
This is my test page I'm trying it on, but I can't get it to work - http://www.fpsgaming.us/test2.html EDIT: I just tried naming it to a .php file, and it worked. But I don't want to rename all my files, so is there a way I can call the function or whatever? EDIT: I hate PHP and I just am going to use JavaScript
root/images/rotation is probably above public_html or htdocs? If so, even if you code the php correct, you won't be able to see images. The webserver can't get to them. EDIT: your images display fine, do the step below. Secondly, you need a little addition to the .htaccess file on that site to tell it to parse PHP in your html file. Add this line to your .htaccess file... AddType application/x-httpd-php .php .html Code (markup): Your example page looks correct except to address those two issues. Don't give up, you are 99% there.
I don't have a pubmlic_html or htdocs I don't think, and the webserver must be able to get to the pics, because it's working with JavaScript. Also, I added that file and it did nothing, then I added a different .htaccess and it made you download my pages instead of viewing them, so I gave up.
Yes, I see them. I edited my post before you read it I guess. What type server are you on, windows or *nix? Do you know if the web server is apache? This is not an expert addition. We should be able to sort it out for you. JS will be fine if you can do that too I'd guess.
I have Godaddy hosting, it says Linux with PHP. I don't know about Apache though... EDIT: Here's my JS test - http://www.fpsgaming.us/test3.html
Nice job. That looks nice. Just goes to show, there's more then one way to skin a cat. I don't know godaddy hosting to help here. I know I have not read good things about it. Maybe someone that does use it can let us know how you can get them to parse php in html.
Well I saw the Godaddy commercials on TV and the ladies had big boobs so I bought from them Just kidding, but I did buy because of their commercial. I didn't know anything about domains/hosting, so I went with the only one I saw advertised.
I have never used it, so my opinion is not a good one to follow. I can't imagine that you can't do what you need done though. I was hoping someone with GD hosting would jump in and give you a tip. That may still happen. Don't let my comment cause to to make a decision without more information.