Computing.Net > Forums > Web Development > Loading new pages into table w/PHP

Loading new pages into table w/PHP

Reply to Message Icon

Original Message
Name: wheelspinner99
Date: February 23, 2005 at 10:57:43 Pacific
Subject: Loading new pages into table w/PHP
OS: n/a
CPU/Ram: n/a
Comment:

Hello, i wanted to know how to load a webpage into a cell of a table using php? I know i can use the iframe in HTML, but i wantedc to be able to to it dynamically. Example:

<table>
<tr>
<td>navigation panel</td>
</tr>
<tr>
<td>content panel - dynamic</td>
</tr>
</table>

Since all pages will use the same header and navigation i wanted a way to just change the content panel. I also am using CSS, may help.


Report Offensive Message For Removal

Response Number 1
Name: Laler
Date: February 23, 2005 at 11:53:17 Pacific
Subject: Loading new pages into table w/PHP
Reply: (edit)

here're 2 sample files, hopefully this can make things clear:

<html>
<body>
<table>
<tr>
<td>navigation panel</td>
</tr>
<tr>
<td><?php include ("somefile.php"); ?></td>
</tr>
</table>
</body>
</html>

let's say the above is called: index.php

now this one:

<strong>Welcome</strong>
<br>
<br>
Welcome to the site

is saved as: somefile.php

now when you call index.php, and viewed the source (from browser), there'll be a single html page, single table, 2 rows, with content of somefile.php as the 2nd row's content...

you can of course create many "somefiles.php" to create multiple pages with the same body, table and td layout, only the 2nd row content are different (depends on the included file)...

you can also do something like this in the index.php

include ($_GET['page']);

so typing: http://site.com?page=somefile.php will call up the file...

another similar tutorial in here:

http://www.phpfreaks.com/tutorials/8/0.php

that I think is the basic templating with php. there are advanced ones which will need more effort at the beginning but will help a lot in the future. :)

---
siggy space for rent



Report Offensive Follow Up For Removal

Response Number 2
Name: fambi
Date: February 23, 2005 at 12:18:08 Pacific
Subject: Loading new pages into table w/PHP
Reply: (edit)

You may also want to include an @ sign before "incude" to suppress ugly error warnings which some times occur.

If you're interested in SMS, visit my wife's site .


Report Offensive Follow Up For Removal

Response Number 3
Name: wheelspinner99
Date: February 24, 2005 at 00:43:16 Pacific
Subject: Loading new pages into table w/PHP
Reply: (edit)

hey, thanks! that worked well!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Loading new pages into table w/PHP

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software