Frames alternative?

U

UKuser

Is there a way that I can load a page within a page and still have
cookies/javascript etc working?

This is my code thus far:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;
charset=windows-1250" />
<link rel="stylesheet" href="css/bbb1.css" type="text/css"
title="Main style" />
<link rel="stylesheet" href="css/top-content.css" type="text/css"
title="Main style" />
<title>Website</title>
</head>
<body>

<div style="background-color:#02A59E;display:block;float:left;width:
100%;height:43px;">
<p>
<span style="float:left;padding-left:20px"><img src="images/link-
logo.jpg"></span>

<h1 style="float:left;margin-left:15px;line-height:43px;vertical-
align:bottom">
<a href="javascript: self.close ()" target="_top"
style="color:white;font-size:14pt">Return to our website</a>
</h1>

<span style="float:right;width:10%;line-height:43px;vertical-
align:bottom;color:white">
<a href="http://<?php print"$site";?>" style="color:white">Remove
Frame</a>
</span>
</p>
</div>

<div style="margin-top:20px;clear:both">
</div>
</body>
</html>
<?php
$content = file_get_contents("http://$site"); // where site is a
www.anyname.com

echo $content;
?>

This will load the page, but as text and/or disable any cookies or
javascript and thus showing the user any external error pages asking
for cookies to be enabled.

I've tried standard iframes and frames but in IE these have cookies/
javascript disabled. I'm trying to find a PHP 100% equivilent to
frames.

Thanks

A
 
B

Bernhard Sturm

UKuser said:
I've tried standard iframes and frames but in IE these have cookies/
javascript disabled. I'm trying to find a PHP 100% equivilent to
frames.
forget the concept 'frames' use includes instead. For php use this in
order to load an external file into your main file:


require_once("myexternalfile.php");


HTH
bernhard
 
U

UKuser

forget the concept 'frames' use includes instead. For php use this in
order to load an external file into your main file:

require_once("myexternalfile.php");

HTH
bernhard

--www.daszeichen.ch
remove nixspam to reply

Hi,

If I do that all the links from the external site point to my website,
i.e.

mysite-root/a-page-I-don't-have.html

I tried this, but the images and links wouldnt work.

Thanks

A
 
M

Martin Jay

If I do that all the links from the external site point to my website,
i.e.

mysite-root/a-page-I-don't-have.html

I tried this, but the images and links wouldnt work.

Have you considered parsing the HTML to correct these problems?

<?php

$content = file_get_contents("http://$site"); // where site is a
www.anyname.com

/* a bit of code here to correct links to pages and images */

echo $content;
?>
 
U

UKuser

Have you considered parsing the HTML to correct these problems?

<?php

$content = file_get_contents("http://$site"); // where site is awww.anyname.com

/* a bit of code here to correct links to pages and images */

echo $content;
?>

I did play with that, but the other problem was duplicating the HTML
start/body/head tags which needed to be stripped out as well. My
problem is I have a directory where I want to open up websites within
it, but display our header on top. One of our listees has cookies
running on their front page, and either iframes or regular frames
didnt like having them.

If theres an alternative solution, I'm open to ideas.

A
 
J

Jonathan N. Little

UKuser said:
I did play with that, but the other problem was duplicating the HTML
start/body/head tags which needed to be stripped out as well.

My
problem is I have a directory where I want to open up websites within
it, but display our header on top. One of our listees has cookies
running on their front page, and either iframes or regular frames
didnt like having them.

If theres an alternative solution, I'm open to ideas.

You have your troubles well set before you, cross-site cookies is a
security hole that browsers makers have been plugging for years. Read up
and see why you are having trouble...

http://www.google.com/search?hl=en&q=cross-site+cookie&btnG=Google+Search
cross-site cookie - Google Search
 
B

Beauregard T. Shagnasty

UKuser said:
My problem is I have a directory where I want to open up websites
within it, but display our header on top.

Begs the question: do you have permission from these websites to
display their pages under your banner?
One of our listees has cookies running on their front page, and either
iframes or regular frames didnt like having them.

"listees" might imply they have 'signed up' to have their content
scraped by you ... is this the case?
 
U

UKuser

Begs the question: do you have permission from these websites to
display their pages under your banner?


"listees" might imply they have 'signed up' to have their content
scraped by you ... is this the case?

yes we have their permission - it was the listee who highlighted their
website link didnt appear to be working
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top