Unstoppable Domains โ€” Get your daily AI drops report

Ad Randomizer?

SpaceshipSpaceship
Watch
Impact
34
Im looking for an ad randomizer, all the ones ive found on the internet are just for images/links but i want it for javascript ads eg, google adsense, theres 2 ads I want too rotate/randomize

anyone know a good script or can make one?


thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Yeah, I think it has something to do with MODx though. MODx uses PHP and can be included in it's pages but it's pages are outputted in HTML.

MODx uses Snippets which are pure PHP and you can then include them in your pages/main template via specific parsing. But it always creates an error for me when I try to do it, or just simply doesn't work.
 
0
•••
nasaboy007 said:
sometimes this works, sometimes it doesnt, but it's worth a shot:

go to your .htaccess file in your root of the site, and add this:
Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

then you shouldn't need to rename all your files to .php and .html files will parse php.


glad to help.

Hi, After I did that the ads no longer display when the rotation script is in the index.html file.

Does it need to go in certain area of the htaccess or anywhere in the file?

Do I still need to activate php on the server even if the index file is not php?

Thanks for your help.
 
0
•••
It can go anywhere in the htaccess file. Is the index file a .html or .htm file? If it's some other extension, be sure to add it to the list under the AddType.
 
0
•••
nasaboy007 said:
It can go anywhere in the htaccess file. Is the index file a .html or .htm file? If it's some other extension, be sure to add it to the list under the AddType.

html

Is it still necessary to turn on php even if the index file is non-php?
 
0
•••
One thing that works is OpenX. Took me a while to figure out (not as long as I thought though) but it rotates the adverts now lol.

www.openx.org (it's free to download)

trader said:
Is it still necessary to turn on php even if the index file is non-php?

It is to my knowledge that it would be. As without the HTACCESS edit you'd have to save files to PHP. I don't see why that's much of a problem though TBH.
 
0
•••
~Psychotic~ said:
It is to my knowledge that it would be. As without the HTACCESS edit you'd have to save files to PHP. I don't see why that's much of a problem though TBH.

It's no big deal just involves a bit of time with the extra steps of logging into the server and activating php.

I did activate php and index.html now works thanks to the code insertion in to my htaccess file

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

which I do with ftp/notepad, so normally no need to login to server outside of ftp.

Special thanks to nasaboy007 This is great news :bingo:
 
Last edited:
0
•••
Glad you finally got it working!
 
0
•••
nasaboy007 said:
Glad you finally got it working!

Thanks, you are so helpful and amazing knowledge.

I have asked similar technical questions at various boards for years and rarely ever got any help let alone feedback that works so well.

P.S. Can that htaccess code have any negative impact on anything else?
 
0
•••
I'm actually looking up some good tricks for .htaccess, some of the stuff is pretty useful and interesting.
 
0
•••
No, the only thing that code does is tells the webserver to look for PHP code in your html files as well as your php files. no adverse effects.
 
1
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back