GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Jul-2003, 18:05
pcxgamer's Avatar
pcxgamer pcxgamer is offline
Senior Member
 
Join Date: Sep 2002
Location: South Carolina, USA
Posts: 1,060
pcxgamer is a jewel in the roughpcxgamer is a jewel in the roughpcxgamer is a jewel in the rough

Question about loading php into tables or css


Hey guys I needed to know if there is any way to use CSS or table instead of frames to load a news system on my page.

Thanks
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
  #2  
Old 03-Jul-2003, 18:53
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

How to include a whole other PHP page into another.


There are quite a few ways to get this done but here's just one to get you started...

Since you didn't supply any details, I'll assume a few first:

The file you want to insert the other page into: index.php.
The other script / page: news.php.
The path to this other page: /home/pcxgamers/public_html/PCXNews/.

In index.php:
PHP Code:

<?php

// FILENAME: index.php

// Let's get the news.php output
ob_start();
require_once( '/home/pcxgamers/public_html/PCXNews/news.php' );
$my_news_page = ob_get_contents();  // we got everything off this other page at this point
ob_end_clean();

// Some html...
?>
<html>
<head>
<title>PCXGamers inserting NEWS.PHP into INDEX.PHP</title>
</head>
<body>
<table>
  <tr>
    <td>Some Menu (You can start another table here even!)</td>
    <td><?php echo $my_news_page; ?></td>
  </tr>
</table>
</body>
</html>

For more info: [gid=http://www.desilva.biz/php/ob_start.html]Include File in a Variable[/gid].
  #3  
Old 03-Jul-2003, 19:19
pcxgamer's Avatar
pcxgamer pcxgamer is offline
Senior Member
 
Join Date: Sep 2002
Location: South Carolina, USA
Posts: 1,060
pcxgamer is a jewel in the roughpcxgamer is a jewel in the roughpcxgamer is a jewel in the rough
how would you do this with links like different links on the page?
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
  #4  
Old 04-Jul-2003, 19:18
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I am afraid you have to change them to the 'index.php' page.

e.g. If this 'news.php' script outputs links like this:
HTML Code:
<a href="/PCXNews/news.php?id=2345&amp;show=all">More News...</a>

you'd have to modify the script/html so that 'news.php' outputs them links like this instead:
[html]
HTML Code:
<a href="/index.php?id=2345&amp;show=all">More News...</a>
  #5  
Old 05-Jul-2003, 02:29
pcxgamer's Avatar
pcxgamer pcxgamer is offline
Senior Member
 
Join Date: Sep 2002
Location: South Carolina, USA
Posts: 1,060
pcxgamer is a jewel in the roughpcxgamer is a jewel in the roughpcxgamer is a jewel in the rough
This is my index.php let me know if you see something wrong with it. I know there is something wrong but not sure what.

HTML Code:
<?php // FILENAME: index.php // Let's get the news.php output ob_start(); require_once( '/home/pcxgamers/www/news.php' ); $my_news_page = ob_get_contents(); // We got everything off this other page at this point ob_end_clean(); ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#999999" link="#8784C6" alink="#8784C6" vlink="#8784C6"><img src="logopcx3.gif"> <table width="100%" height="5" cellpadding="0" cellspacing="0" border="0" bgcolor="#8784C6"> <tr valign="top"> <td class="topbar2"><a href="#">Home</a><a href="#">About</a> <a href="#">Forums</a> <a href="#">Links</a></td> </tr></table> <table width="100%" cellpadding="0" cellspacing="10" border="0"> <tr valign="top"> <td width="100%"> <table width="100%" cellpadding="10" cellspacing="0" bgcolor="#E9E9F8" bordercolor="#8784C6"> <tr valign="top"> <td bordercolor="#E9E9F8"> <?php echo $my_news_page; ?> </td> </tr> </table> </td> <td width="170" bordercolor="#8784C6"> <table width="170" bgcolor="#E9E9F8" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td bordercolor="#E9E9F8"> <table width="170" bgcolor="#C1C1E8" cellpadding="0" cellspacing="0" bordercolor="#8784C6" border="1"> <tr valign="top"> <td height="17" bordercolor="#C1C1E8"><div align="center" class="topbar2"><span class="topbar"><strong>SITE NAVIGATION</strong></span></div></td> </tr> </table> <table width="100%" cellpadding="8" cellspacing="0" border="0"> <tr valign="top"> <td height="167"> <table width="100%" border="0"> <tr> <td><div align="center"><a href="#">» Morrowind</a></div></td> </tr> <tr> <td><div align="center"><a href="#">» My Work</a></div></td> </tr> </table> </td> </tr> </table></td> </tr> </table> <BR> </td> </tr> </table> </td> </tr> </table> </body> </html>
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
Last edited by pcxgamer : 05-Jul-2003 at 03:05.
  #6  
Old 05-Jul-2003, 06:42
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Actually, you should be more concerned about the html being output by 'news.php' rather than 'index.php'.
  #7  
Old 17-Sep-2005, 21:08
onceover onceover is offline
New Member
 
Join Date: Sep 2005
Posts: 1
onceover is on a distinguished road
probably a giant bump, sorry if it is.

im trying to make my page, and while looking at your code, i dont understand how you would make a link load a page into the table without loading a new page with the php script to load information into a table
 

Recent GIDBlogPrepping for deployment by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing your web server with Turck MMCache for PHP JdS Web Hosting Forum 2 07-Jan-2004 07:48
apache2 - php cgi fehler - schleife inna Apache Web Server Forum 8 27-Nov-2003 09:55
Automate a data change php form mjfmn MySQL / PHP Forum 4 20-Oct-2003 09:37
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 16:14
PHP Sessions question JdS MySQL / PHP Forum 2 16-Jul-2002 04:58

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:19.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.