iNET Interactive - Online Advertising Agency
          
   Home    Authors    About    Login    Contact Us
   Search:   
Advanced Search     
  Articles

  ASP (26)
  ASP.NET (19)
  C and C++ (4)
  CFML (2)
  CGI and Perl (16)
  Flash (2)
  Java (7)
  JavaScript (28)
  PHP (92)
  MySQL (13)
  MSSQL (3)
  HTML (34)
  SEO (9)
  Visual Basic (12)
  CSS (13)
  SSI (5)
  XML (12)
  C# (14)

  Developer News

May 11, 2008
Improving accessibility for motor impaired users
WebDevTips UK
 
May 11, 2008
10 ways to orientate users on your site
WebDevTips UK
 
May 11, 2008
Web Design Clinic - Rros restoration camp 2006
About
 
May 10, 2008
The Moods of Facebook
About
 
May 9, 2008
CSS 1 properties are a great start
About
 
May 9, 2008
Reader Question: How do you get fancy fonts?
About
 
Courtesy of moreover.com
 
Want to receive new articles via e-mail? Click here!
/Home /PHP

Inserting another page on your page without using frames 

  Views:    3710
  Votes:    3
by Diego Botello 12/11/03 Rating: 

Synopsis:

This shows a way to insert one page within the other without the use of frames.
Pages: 
The Article

This code is useful for example if you want to make a script for a links directory and you want to add a frame on top of each page you referrer. Or if you want to make a traffic exchange script and want to add a frame of top of each page loaded on the traffic exchange.

To make this what we do is to call the page that we want to load using fopen() and then printing that page. fopen() is the function used to open files.

In the example below we are giving two parameters http://www.yahoo.com which is the page we want to open and r that indicates that we are opening it for reading.

<html>

<head>

<base href="http://www.yahoo.com">

</head>

<body>

<table border=1 width=100%>

<tr>

<td>This is a sample frame</td>

<td><?php

$page = fopen( "http://www.yahoo.com", "r" );

while ( ! feof( $page ))

print fgets( $page, 1024 );

fclose( $page );

?>

</td>

<td>This is a sample frame</td>

</tr>

</table>

</body>

</html>

The base tag on the head of the page is necessary to make all downloads relative to that page. If we don't use that tag then it's probable that the images will appear broken.

Pages: 

Similar/related articles:


 
  Sponsors