Forum Moderators: coopster
<?php
header( 'Location: http://example.com/toplist/images/1.png' ) ;
?>
Then I make it
<img src="http://example.com/top.php"> it work and image shown.
My problem is, I want make some inline frame like this
<iframe src="http://example.com/track.php"></iframe>
<?php
header( 'Location: http://example.com/toplist/images/1.png' ) ;
?>
and save to top.php
when I used it with
<img src="http://example.com/top.php">
It's error and cannot work...
How to make it work...
Example :
I use <img src="http://example.com/top.php"> then image shown and my url loaded too...
Thank You very much for your help...
Sorry my english is so bad and I'm newbie in PHP :)
[edited by: dreamcatcher at 3:02 pm (utc) on April 2, 2009]
[edit reason] use example.com. Thanks. [/edit]
I think I remember that sometimes header() must be the first statement in the file, with nothing, not even a blank line, above it. This is because as soon as any content is sent, the headers are sent with it, and after that it's too late to send any headers.
I'm only guessing. I don't know if this applies to your situation. But it's a place to start until somebody comes along with a more certain answer.
If I'm reading this right, you are abusing header(). Header is not a page header, it is for http headers to inform the client (browser) of the type of content that is coming. The only time you user header("Location . . . ") is to redirect to a different web page.
What you want is probably more like this:
<?php
header("Content-type:text/html\n\n");
print '<img src=http://example.com/toplist/images/1.png">'
// Or echo:
// echo '<img src=http://example.com/toplist/images/1.png">'
?>