| |
|
Welcome to KnowledgeSutra - Dear Guest | |
How Do You Have Static Ads?
Started by TiKiRoKhaN, Mar 18 2006 10:06 PM
12 replies to this topic
#1
Posted 18 March 2006 - 10:06 PM
Like seen on www.trap17.net I have been trying to put static ads on all of my site without having to type
include (file.php)
and stuff like that, I want my ads to appear on HTML to!
How is it possible to make it like trap17.net did it, please help I need this bad ;(
include (file.php)
and stuff like that, I want my ads to appear on HTML to!
How is it possible to make it like trap17.net did it, please help I need this bad ;(
#2
Posted 18 March 2006 - 10:22 PM
Sorry, but you weren't completely clear in what you wanted. Do you want to have one specific ad banner (being "static"?) in each area on your site? If so why don't you just use html to add the images in?
e.g. <img src="/images/ad1.jpg">
Then, if you wanted to change the ad displayed later you'd just upload another banner with the same name.
Another alternative would be to use iframes, which is, in essence, like embedding a second webpage within the first.
Your code would look something like:
<IFRAME src="adbanner.html" width="400" height="500" frameborder="1">
[Your web browser doesn't support iframes...lucky you!]
</IFRAME>
Then you'd just make adbanner.html with the add you wanted it. Or you could iframe to a php document if you wanted it to randomly display an ad.
Hope that was helpful. If not, please try and clearify your question.
e.g. <img src="/images/ad1.jpg">
Then, if you wanted to change the ad displayed later you'd just upload another banner with the same name.
Another alternative would be to use iframes, which is, in essence, like embedding a second webpage within the first.
Your code would look something like:
<IFRAME src="adbanner.html" width="400" height="500" frameborder="1">
[Your web browser doesn't support iframes...lucky you!]
</IFRAME>
Then you'd just make adbanner.html with the add you wanted it. Or you could iframe to a php document if you wanted it to randomly display an ad.
Hope that was helpful. If not, please try and clearify your question.
#4
Posted 19 March 2006 - 01:42 AM
TiKiRoKhaN, on Mar 18 2006, 11:16 PM, said:
I want my google adsense to be static on every page, thats what i was asking, on PHP and HTML
Ah, ok. Then your best bet is to use Iframes like i suggested. Basicly, just make a webpage (html, php, whatever) that just displays adsense. Then use an iframe to include it where you want it.
Some guy did something kinda like that with SSI (http://forums.digita...read.php?t=3255) but i havn't tried that method myself.
#7
Posted 19 March 2006 - 04:45 AM
Sorry, I miss understood you then
searched around on google for a little bit and i found:
Code looks something like:
Hope that helped
searched around on google for a little bit and i found:
Quote
[Syntax: ]auto_prepend_file string
Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the include() function, so include_path is used.
The special value none disables auto-prepending.
Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the include() function, so include_path is used.
The special value none disables auto-prepending.
Code looks something like:
Quote
AddType application/x-httpd-php htm html
< FilesMatch "\.(html?)$" >
php_value auto_append_file "/the/path/that/leads/to/count.php "
</FilesMatch >
< FilesMatch "\.(html?)$" >
php_value auto_append_file "/the/path/that/leads/to/count.php "
</FilesMatch >
Hope that helped
Edited by gaea, 19 March 2006 - 04:46 AM.
#10
Posted 19 March 2006 - 05:59 AM
I'm not 100% certain because i've never done this before. From what i saw it looks like you can either put that into your php.ini, or into a .htaccess.
AddType application/x-httpd-php .php .htm .html
//Tells the server to treat html and htm files as php files.
< FilesMatch "\.(php?)$" >
php_value auto_prepend_file "/the/path/that/leads/to/count.php "
</FilesMatch >
//Adds your adpage (e.g. /the/path/that/leads/to/count.php) to beginning of all php files.
Might not have everything perfect, but i think that's close.
AddType application/x-httpd-php .php .htm .html
//Tells the server to treat html and htm files as php files.
< FilesMatch "\.(php?)$" >
php_value auto_prepend_file "/the/path/that/leads/to/count.php "
</FilesMatch >
//Adds your adpage (e.g. /the/path/that/leads/to/count.php) to beginning of all php files.
Might not have everything perfect, but i think that's close.
Edited by gaea, 19 March 2006 - 06:12 AM.
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














