Using PHP to build HTML frames

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
48k
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2009 5:46 pm

Using PHP to build HTML frames

Post by 48k »

Hi all,
I am using PHP to open a new browser window to a affiate site which works well most of the time, however they are using a geo-location script which does not work well with non USA traffic. The only solution I can work out is to open a window in a frame (small top frame, big bottom frame) and then after a few seconds fresh to the target page.

header ('HTTP/1.1 301 Moved Permanently');
header("Location: " . $item_url);

were '$item_url' is the link to the external site.


As the top frame opens, the bottom frame opens to the affiate site and can set the cookies which are needed.

Then, after a few seconds the frame resets to the target bottom frame (with the cookies) which then work correct.

I've tried this by hard coding it in HTML however I need to do this using PHP as the external link is updated each time.

So how do I build a HTML frame page using PHP?

Top frame: My small frame with a timer (1 second)
Bottom frame:Is the '$item_url' URL (cookies get loaded)

After 1 second the whole frame redirects to '$item_url'

Many Thanks http://www.cutpriceposters.com
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Using PHP to build HTML frames

Post by Syntac »

You know, you can just embed PHP in the hardcoded HTML file.
48k
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2009 5:46 pm

Re: Using PHP to build HTML frames

Post by 48k »

Most of the site is built using HTML in PHP and PHP in HTML. There is over 500,000 wall posters items for sale on the site using only 4 HTML pages and XML data feeds. I need to create HTML frames on the fly.... Or would it be possable using layers???

Thanks
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Using PHP to build HTML frames

Post by omniuni »

Why not just target="_blank" on your link, and open a regular HTML page that you write in the new window with an HTTP redirect to their page?

Code: Select all

<meta http-equiv="Refresh" content="10; URL=http://example.com">
Post Reply