I've attached the coding below. Basically, the links don't pass variables. The applicable lines are surrounded by ########.
I'm completely stumped. Can you find the error?
<?PHP
session_start();
include("dblib.inc");
include("dynamicmenu.inc");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<title>Search results</title>
<Link href="arial.css" rel=stylesheet title=arial type=text/css>
<body>
<BR>
<img src="pics/logo.gif"><BR>
<BR>
<B><a href="search.php">Search again</a></b>
<B><a href="memberprofile.php?<?=$PHPSESSID; ?>">Back to home</a></b>
<BR>
<BR>
<table width="640" cellpadding="0" cellspacing="0">
<TR>
<TD><?PHP include ("navigation.inc"); ?></td>
<TD>
<?PHP
//query for matches
if (CCity == "CNone")
{
//Use this query when city NOT specified
$query = "SELECT CFirstName, CLastName, CCity, CEmail, CID
FROM clients, interests
WHERE (I1 = '$Interests' OR I2 = '$Interests' OR I3 = '$Interests' OR I4 = '$Interests' OR I5 = '$Interests' OR I6 = '$Interests' OR I7 = '$Interests')
AND clients.cusername = interests.cusername
ORDER BY CCity, CLastName";
}
else
{
//Use this query when city IS specified
$query = "SELECT CFirstName, CLastName, CCity, CEmail, CID
FROM clients,interests
WHERE (I1 = '$Interests' OR I2 = '$Interests' OR I3 = '$Interests' OR I4 = '$Interests' OR I5 = '$Interests' OR I6 = '$Interests' OR I7 = '$Interests'
AND CCity = '$CCity')
AND clients.cusername = interests.cusername
ORDER BY CCity, CLastName";
}
$answer = mysql_query($query);
$total_rows = mysql_num_rows($answer);
if($total_rows == 0)
print "<BR><font color=red>Sorry! No profiles matched your search criteria</font><BR>";
else
print "Found <B>$total_rows profiles</b> that matched your search criteria.<BR><BR>";
//Prints out the results of your query
print "<table border=1 cellpadding=5 cellspacing=0>";
print "<TR>";
print "<TD bgcolor=\"#dddddd\"><B>#</b></td>";
print "<TD bgcolor=\"#dddddd\"><B>Name</b></td>";
print "<TD bgcolor=\"#dddddd\"><B>Email</b></td>";
print "<TD bgcolor=\"#dddddd\"><B>City</b></td>";
print "<TD bgcolor=\"#dddddd\">
<a href=\"faqbuddylist\" target=\"new_window\"><B>Buddy list</b></a>
</td>";
print "</tr>";
for ($loopvar=0; $loopvar<$total_rows; $loopvar++)
{
//This queries others with the same interests
$row = mysql_fetch_object($answer);
$tempvar = $loopvar+1;
print "<tr>";
print " <TD>$tempvar</td>
############################################################################
<TD><a href=\"memberdetails.php?CUserName=$row->CUserName\">$row->CFirstName $row->CLastName</a></td>
############################################################################
<TD><a href=\"mailto:$row->CEmail\">$row->CEmail</a></td>
<TD>
<font size=-1>
#################################################################################
<B><a href=\"buddyadded.php?CUserName=$row->CUserName\">Add $row->CUserName to my buddy list</a></b>
#################################################################################
</font>
</td>";
print "</tr>";
}
print "</table>";
print "<BR><BR>";
?>
</td>
</tr>
</table>
<BR>
<B><a href="searchbyactivity.php">Search again</a></b>
<B><a href="memberprofile.php?<?=$PHPSESSID; ?>">Back to home</a></b><BR>
<BR>
* LDSAlberta.com does its best to regularly screen profiles and ensure they are up to church standards and appropriate in the spirit of the site. If you find any inappropriate profiles or offensive material.<BR>
Please <a href="badprofile.php" target="new_window">click here</a> to report them and we will follow-up on this matter shortly.<BR>
</body>