Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need Help with Iframe in PHP
Old 04-02-2009, 07:11 AM Need Help with Iframe in PHP
Bambosi's Avatar
Skilled Talker

Posts: 79
Name: Bambosi
Location: @ My Desktop
Trades: 0
I make file top.php and put on my htdocs
Quote:
<?php
header( 'Location: http://localhost/toplist/images/1.png' ) ;
?>


Then I make it


Quote:
<img src="http://localhost/top.php">

it work and image shown.


My problem is, I want make some inline frame like this


Quote:
<iframe src="http://mysite.com/track.php"></iframe>
<?php
header( 'Location: http://localhost/toplist/images/1.png' ) ;
?>


and save to top.php
when I used it with


<img src="http://localhost/top.php">


It's error and cannot work...
How to make it work...
Example :


I use <img src="http://mysite.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
__________________
Read Our
Please login or register to view this content. Registration is FREE
@ My Blog
Get All Premium
Please login or register to view this content. Registration is FREE

Bambosi is offline
Reply With Quote
View Public Profile Visit Bambosi's homepage!
 
 
Register now for full access!
Old 04-02-2009, 08:00 AM Re: Need Help with Iframe in PHP
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Headers need to come before any output to the browser. In other words, you can't output an IFRAME, then have a location header, though I'm confused as to your reasons for doing so.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-02-2009, 08:21 AM Re: Need Help with Iframe in PHP
Bambosi's Avatar
Skilled Talker

Posts: 79
Name: Bambosi
Location: @ My Desktop
Trades: 0
Just to posting some image to some sites... And my image will shown and my web get traffic for track
__________________
Read Our
Please login or register to view this content. Registration is FREE
@ My Blog
Get All Premium
Please login or register to view this content. Registration is FREE

Bambosi is offline
Reply With Quote
View Public Profile Visit Bambosi's homepage!
 
Old 04-02-2009, 08:55 AM Re: Need Help with Iframe in PHP
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
so you're using the IFRAME for some sort of tracking? In that case, you'll have to do the redirect with <meta>
HTML Code:
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://example.com/" />
</head>
<body>
<iframe src="http://mysite.com/track.php"></iframe> 
</body>
</html>
This will have a slight delay as the HTML loads (header redirects are pretty much instantaneous), but will allow you to use the IFRAME to track whatever.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-02-2009, 09:13 AM Re: Need Help with Iframe in PHP
Bambosi's Avatar
Skilled Talker

Posts: 79
Name: Bambosi
Location: @ My Desktop
Trades: 0
Thank You for your help

But it can't use with <img src="bla bla bla">

For example like this picture



it use <img src="http://banner.cavaliertickets.info/banner.php?id=63806">

It's banner.php (PHP File) and not JPG file, and I need to put script to load my web like iframe.

So when I use <img src="http://myweb/file.php"> it will load my web by iframe (or something like that) then go to image file.

Thank you very much for your help bro
__________________
Read Our
Please login or register to view this content. Registration is FREE
@ My Blog
Get All Premium
Please login or register to view this content. Registration is FREE


Last edited by Bambosi; 04-02-2009 at 09:15 AM..
Bambosi is offline
Reply With Quote
View Public Profile Visit Bambosi's homepage!
 
Old 04-02-2009, 09:35 AM Re: Need Help with Iframe in PHP
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
The php file you pointed at has a response header of

"Content-Type: image/gif"

So it IS an image as far as the browser is concerned, and can't be used to serve IFRAMES or load web pages.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-02-2009, 10:26 AM Re: Need Help with Iframe in PHP
Bambosi's Avatar
Skilled Talker

Posts: 79
Name: Bambosi
Location: @ My Desktop
Trades: 0
how if like this...

edit my index.php... So the result is like this

http://www.myweb.com/index.php?goto=image

so my web will be loaded then go to image...

It's right ???

Thanks for your help
__________________
Read Our
Please login or register to view this content. Registration is FREE
@ My Blog
Get All Premium
Please login or register to view this content. Registration is FREE

Bambosi is offline
Reply With Quote
View Public Profile Visit Bambosi's homepage!
 
Old 04-02-2009, 10:44 AM Re: Need Help with Iframe in PHP
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I guess I am confused about what your intentions are with the page. Are you saying all you need is to output the page, then show the image? In that case, just output the page normally (don't use an iframe) then link to the image as normal, with an <img> tag. There is nothing special about PHP that will prevent you from doing so.

You could, if you wish, just include the section that you want onto the page:
PHP Code:
<?php include "/track.php";?>
<img src="/toplist/images/1.png" />
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Need Help with Iframe in PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27395 seconds with 12 queries