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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Loading new pages into table w/PHP

Reply to Message Icon

Name: wheelspinner99
Date: February 23, 2005 at 10:57:43 Pacific
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.



Sponsored Link
Ads by Google

Response Number 1
Name: Laler
Date: February 23, 2005 at 11:53:17 Pacific
Reply:

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



0

Response Number 2
Name: fambi
Date: February 23, 2005 at 12:18:08 Pacific
Reply:

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 .


0

Response Number 3
Name: wheelspinner99
Date: February 24, 2005 at 00:43:16 Pacific
Reply:

hey, thanks! that worked well!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Loading new pages into table w/PHP

AJAX Problem: Loading Page into Div www.computing.net/answers/webdevel/ajax-problem-loading-page-into-div/3398.html

Accessing data from a db w/ php www.computing.net/answers/webdevel/accessing-data-from-a-db-w-php/128.html

php help needed www.computing.net/answers/webdevel/php-help-needed/2399.html