Re: Table question (displaying an html file in a cell....)

by "Raj Bhaskar" <raj(at)lordofthemoon.com>

 Date:  Thu, 12 Apr 2001 11:36:05 +0100
 To:  hwg-basics(at)mail.hwg.org
 Cc:  ed(at)celticblues.com
 In-Reply-To: 
  todo: View Thread, Original
Hi Ed,

> I am using a table to layout my webpages....If I have a 2 column table, and
> the left column cotains a list of links, is there a way to display the
> contents of the html file retrieved by the link?

I can't think of any way to do this directly in HTML, but it can be done 
fairly easily in something like PHP or JSP.  The basic idea is to make 
the links in the left hand cell point to the same page but with a parameter 
set (eg <.a href="thispage.php?name=John">John</a> -- this could be 
done directly or pulled out of a database) and then use this parameter to 
dynamically include the appropriate file in the right hand cell.  Try 
something like this (in PHP):

<.table>
<.tr><.td>
<.a href="thispage.php?name=John">John<./a><.br>
<.a href="thispage.php?name=Ted">Ted<./a>
<./td><.td>
<?php
	if (isSet($name))
		{
			$filename= $file . ".html";
			include($filename);
		} // end if
?>
<./td><./tr>
<./table>

I'm sure that someone will correct me if I've made a mistake, or if there's 
an easier way to do it :o).

HTH,
Raj.
-- 
__        __
|   |	|   |   Raj Bhaskar, University of Glasgow
|_ / 	|_ /    E-Mail: raj(at)lordofthemoon.com
|   \	|   \   Home Page: http://lordofthemoon.com
|    \	|__/   
As far as Death was aware, the sole reason for any human association with
pigs and lambs was as a prelude to sausages and chops.  Quite why they should
dress up for children's wallpaper as well was a mystery.
	-- (Terry Pratchett, Hogfather)

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.