Maybe do this instead of your image tag:
<?php include "/path/to/adsense.txt";?>
with adsense.txt containing your whole adsense <script>.
it is not clear, what kind of problem you are try to solve.
Your script does not show the image?
You are trying to load remote image and display it?
or what exactly? Could you please describe the problem
Ok lets say I wanna use
and url.php is what i'm focusing on.
In url.php I put the google ad script.
But it will not work is there something i'm missing?
I wanted to try on my forums and see if I could paste the html snippet (<img src="url.php">) and see if my adsense ad appeared.
Are you saying you want to include an image that is fetched through PHP code? It certainly seems that way if you are pushing it out through and <img> element. And if so, perhaps this thread will help:
How to convert image blob files back to image [webmasterworld.com]
And hey, welcome to WebmasterWorld, newbie2006 ;)
It sounds to me like you're trying to include the adsense code with the image tag. Why not just use include?
For use this part of code that in some file, this file has to be work by php, simple .html will not work with it. It has to be either .phtml, .php or somethign that work through php.
Why not having HTML parsing PHP
using " .htaccess "
try one line or the other
AddHandler application/x-httpd-php .html
AddType application/x-httpd-php .html
set it up in httpd.conf
find that line:
AddType application/x-httpd-php .php
add .html to the end
AddType application/x-httpd-php .php .html
if you do not have root access ask your ISP to perform it on your behalf.
henry0, do not mislead the man.
WHat for to do the include, what for to make any changes in the apach configuration?
If he/she has the windows server!
The method that ball4121 used is full logical and full correct. In real the question is in what exactly the php file has to print and where from to take the data for it.
If ball4121 just could not print file from binar, then your method will not solve the problem, but only bring more troubles.
the post is not clear!
I did think that the poster was trying to parse PHP via HTML
ARE YOU THE MIRADOR KEEPER
well, let's all take a moment here, we should all know the adage about "nothing nice to say..."
ball4121, if you are going to have a php script in an image tag, then that php script has to return an image. If you are trying to get anything else besides an image in there then it isn't going to work.
if you are trying to include some kind of generated output that isn't an image and you don't want to put the code right into your page then the option of using an include is the right one and you will have to make the page parsable for php.
henry0 mentioned above how to do that on apache, if you are using IIS then you will have to do some searches to figure out how that is done.
I don't see why you can't just put the ad code right into your html page. I am guessing that you can then include it across all pages but not really sure if that is why.