ok so maybe i forgot to turn register_globals back off, I still have the same problem, i click on the link and nothing i added the $_get['id'] thing and it dident fix it. Here is an update of the code, any help would be greatly appreciated
PHP Code:
<?php
session_start();
include 'db.php';
if (!isset($id)):
?>
<body bgcolor="#F5E9E9">
<table width="304" bgcolor="#F5E9E9" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="17" width="300" colspan="3"></td>
</tr>
<tr>
<td width="300" colspan="3" height="17"> </td>
</tr>
<tr>
<td width="300" colspan="3">
<div align="center"> <b><font size="3">Module List</font></b><br><BR>
<?
mysql_select_db($database_name, $connection);
//definine table sections here
// Counter Strike
$listquery = "SELECT * FROM scenario WHERE active = '1'";
$list = mysql_query($listquery, $connection) or die(mysql_error());
$num_results = mysql_num_rows($list); //Row Count
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_assoc($list);
$rowid = $row["ID"];
$rowname = $row["Name"];
echo "<a href='?id=$rowid'>$rowname</a><br>";
}
mysql_free_result($list);
?>
</div>
</td>
</tr>
<tr>
<td width="300" colspan="3" height="17"> </td>
</tr>
<tr>
<td height="17" background="images/site/bottom_1.gif" width="130"></td>
<td height="17" background="images/site/bottom_2.gif" width="146"></td>
<td height="17" background="images/site/bottom_3.gif" width="28"></td>
</tr>
</table>
</body>
<? else: ?>
<?
mysql_select_db($database_name, $connection);
$sql = 'SELECT * FROM scenario WHERE id='.$_GET['ID'].'';
$result = mysql_query($sql, $db) or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$name = $row['Name'];
$description = $row['Description'];
$correct1 = $row['Correct1'];
$wrong1 = $row['Wrong1'];
$wrong12 = $row['Wrong1-2'];
$correct2 = $row['Correct2'];
$wrong2 = $row['Wrong2'];
$wrong22 = $row['Wrong2-2'];
$correct3 = $row['Correct3'];
$wrong3 = $row['Wrong3'];
$wrong32 = $row['Wrong3-2'];
$correct4 = $row['Correct4'];
$wrong4 = $row['Wrong4'];
$wrong42 = $row['Wrong4-2'];
$correct5 = $row['Correct5'];
$wrong5 = $row['Wrong5'];
$wrong52 = $row['Wrong5-2'];
$correct6 = $row['Correct6'];
$wrong6 = $row['Wrong6'];
$wrong62 = $row['Wrong6-2'];
$correct7 = $row['Correct7'];
$wrong7 = $row['Wrong7'];
$wrong72 = $row['Wrong7-2'];
$correct8 = $row['Correct8'];
$wrong8 = $row['Wrong8'];
$wrong82 = $row['Wrong8-2'];
$correct9 = $row['Correct9'];
$wrong9 = $row['Wrong9'];
$wrong92 = $row['Wrong9-2'];
$correct10 = $row['Correct10'];
$wrong10 = $row['Wrong10'];
$wrong102 = $row['Wrong10-2'];
$question1 = $row['Question1'];
$question2 = $row['Question2'];
$question3 = $row['Question3'];
$question4 = $row['Question4'];
$question5 = $row['Question5'];
$question6 = $row['Question6'];
$question7 = $row['Question7'];
$question8 = $row['Question8'];
$question9 = $row['Question9'];
$question10 = $row['Question10'];
$active = $row['active'];
}
mysql_free_result($result, $connection);
?>
<body bgcolor="c0c0c0">
<table width="304" bgcolor="c0c0c0" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="300" colspan="3">
<div align="right">
<p align="center"><font size="6">
<? echo $name; ?>
</font> <br>
<img src="images/site/news_300_break.gif" width="304" height="7"><br>
</div>
<div align="center">
<?
if ($active == "1")
{
?>
<BR><BR><b>::Test::</b><BR>
<b>Name:</b> <? echo $name; ?> <BR>
<b>Description:</b> <? echo $description; ?> <BR>
<b>Rank:</b> <? echo $rank; ?> <BR>
<b>Location:</b> <? echo $location; ?> <BR>
<b>Personal Site:</b> <a href="<? echo $website; ?>"><? echo $website; ?></a> <BR><BR>
<b>::Counter-Strike::</b><BR>
<b>Favourite Weapon:</b> <? echo $cs_primary_weapon; ?> <br>
<b>Favourite Handgun:</b> <? echo $cs_secondary_weapon; ?><br>
<b>Favourite Server:</b> <? echo $server; ?><BR>
<b>Favourite Team:</b> <? echo $team; ?><BR>
<b>Average hours A week playing <? echo $division; ?>:</b> <? echo $hours; ?><BR>
<b>Have been playing <? echo $division; ?> for how long:</b> <? echo $time; ?><BR>
<b>Favourite Map:</b> <? echo $map; ?><br>
</div>
<div align="center">
</div>
<br>
</td>
</tr>
</table>
</body>
<?php };
endif; ?>
Bookmarks