ok....i have been working on this for a while, but i am not really getting anywhere with it! i have figured it out so that when you click on a link in the top menu (which contains a $bid) then all of the correct left menu links are coming up for that particular $bid...however, when you click on a left menu link (which also contains a $bid and a $said) then the corresponding content (said) is displayed correctly, but then I get and error saying that there is an undefined index bid.
what i need to do is pass the bid in again, so that it know which left menu to display with the content...can you redefine a variable which is already used? or does it have to be a new variable....here is the code that i have...in case it helps you to look at it!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>All North Enterprises Ltd.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL=STYLESHEET TYPE="text/css" HREF="AboutUsCSS.css">
</head>
<body>
<div class="headerBG"></div>
<div class="imgposition"><a href = "index.php"><img src="/allnorth_test/images/logo.jpg" width="155" height="70" name="Logo" border="0"></a></div>
<div class="bannerpos"><img src="/allnorth_test/images/mountain1.jpg"></div>
<?
//includes database logon information
require('db-include.ini');
//select all of the data from Business Section
$stmt = OCIParse($connection, "SELECT *
FROM BUSINESS_SECTION
ORDER BY BUSINESS_SECTION_NAME");
?>
<!-- ********************* MENU *************************** -->
<div class= "menuBg">
<?
OCIExecute($stmt);
// Loop through results
while(OCIFetch($stmt))
{
//Assign variables from the database
$link = OCIResult($stmt, 'BUSINESS_SECTION_LINK') ;
$bname = OCIResult($stmt, 'BUSINESS_SECTION_NAME') ;
$bid = OCIResult($stmt, 'BUSINESS_SECTION_ID');
?>
<a href="<?PHP echo $_SERVER['PHP_SELF']; ?>?bid=<?PHP echo $bid; ?>" CLASS="btn"><? echo $bname;
?></a>
<? } ?>
</div>
<!-- ********************* LEFT *************************** -->
<div id="left"><TABLE CELLSPACING="0" CELLPADDING="2" BORDER="0">
<?
$temp = $_GET['bid'];
//select all of the data from Business Section
$stmt = OCIParse($connection, "SELECT *
FROM SECTION_ACTIVITY
WHERE BUSINESS_SECTION_ID = $temp
ORDER BY SECTION_ACTIVITY_ID");
@OCIExecute($stmt);
// Loop through results
while(@OCIFetch($stmt))
{
//Assign variables from the database
@$link = OCIResult($stmt, 'SECTION_ACTIVITY_LINK') ;
@$Sname = OCIResult($stmt, 'SECTION_ACTIVITY_NAME') ;
$said = OCIResult($stmt, 'SECTION_ACTIVITY_ID');
$tbid = OCIResult($stmt, 'BUSINESS_SECTION_ID');
?>
<TR><td><a href="<?PHP echo $_SERVER['PHP_SELF']; ?>?said=<?PHP echo $said; ?>&?tbid=<?PHP echo $tbid; ?>"><? echo $Sname; ?></a><hr width= 140></td><tr>
<?
}
// As always, free the resources.
OCIFreeStatement($stmt);
OCILogoff($connection);
?>
</table>
</div>
<!-- ********************* MIDDLE *************************** -->
<div id = "middle">
<?
$tempbid = $_GET['tbid'];
echo $tempbid;
if (isset($_GET['said']))
{
$aSAID = $_GET['said'];
echo $aSAID;
//select all of the data from Business Section
$stmt = OCIParse($connection, "SELECT *
FROM SECTION_ACTIVITY
WHERE SECTION_ACTIVITY_ID = $aSAID ");
OCIExecute($stmt);
OCIFetch ($stmt);
$SAName = OCIResult($stmt, 'SECTION_ACTIVITY_NAME') ;
?>
<h1><? echo ($SAName); ?></h1>
<?
//select the data from the Activity Details table
$sql= OCIParse($connection, "SELECT H.HEADER_NAME,AD.SECTION_HEADER_DETAILS
FROM HEADER H,ACTIVITY_DETAILS AD
WHERE AD.HEADER_ID = H.HEADER_ID
AND AD.SECTION_ACTIVITY_ID = $aSAID ");
OCIExecute($sql);
?>
<table>
<? //loop through results
while(OCIFetch ($sql))
{
$HName = OCIResult($sql, 'HEADER_NAME') ;
$SHDetails = OCIResult($sql, 'SECTION_HEADER_DETAILS') ;
?>
<tr><td><h2><? echo($HName) ?></td></h2></tr>
<tr><td><h3><? echo($SHDetails) ?></h3></td></tr>
<? } ?>
</table>
<? }
else
{
echo ?> <table>
<tr><td><h1>All North Enterprises Ltd.</h1></td></tr>
<tr><td> All North Enterprises Software Division specializes in Database Consulting.<br>
Our services include training, consultation, programming, and administation of database software. We primarily use the worlds leading database program; Oracle.<br><br>
All North is also the sole Oracle partner company in the Yukon ensuring that companies developing in the Yukon receive the best possible value for money.
All North also has expertise in Microsoft Access, as well as SQL Server 7.0.
For further information, please select an option above, or contact us by email, phone or fax.</td></tr><table>
<? } ?>
</div>
<!-- ********************* TEXT LINKS *************************** -->
<div id="textlinks">
<table><tr><td>|</td>
<?
//select all of the data from Business Section
@$stmt = OCIParse($connection, "SELECT *
FROM BUSINESS_SECTION
ORDER BY BUSINESS_SECTION_NAME");
OCIExecute($stmt);
// Loop through results
while(OCIFetch($stmt))
{
//Assign variables from the database
@$link = OCIResult($stmt, 'BUSINESS_SECTION_LINK') ;
@$bname = OCIResult($stmt, 'BUSINESS_SECTION_NAME') ;
$bid = OCIResult($stmt, 'BUSINESS_SECTION_ID');
?>
<td><a href="<?PHP echo $_SERVER['PHP_SELF']; ?>?bid=<?PHP echo $bid; ?>"><? echo $bname; ?></a>|</td>
<? } ?>
</tr></table>
</div>
<!-- ********************* RIGHT *************************** -->
<div id= "right">
<script language=javascript type="text/javascript">var city = 'whitehorse_YT';</script>
<script language=javascript type="text/javascript" src='http://www.theweathernetwork.com/weatherbutton/test.js'></script>
</div>
<div class="ruleLeftV"></div>
<div class="ruleRightV"></div>
</body>
</html>
i hope that you can help...
thanks.
sp