Here is the entire document - some of it like the session stuff at the top is there for experimenting.
<?php require_once('Connections/connect.php'); ?>
<?php
// FELIXONE - 2002 SB by Felice Di Stefano - www.felixone.it
if (!session_id()) session_start();
if (isset($HTTP_POST_VARS['questionnum'])) {$questionnumber = $HTTP_POST_VARS['questionnum'];
session_register("questionnumber");
}
// FELIXONE - 2002 SB by Felice Di Stefano - www.felixone.it
if (!session_id()) session_start();
if (isset($HTTP_POST_VARS['question'])) {$thequestion = $HTTP_POST_VARS['question'];
session_register("thequestion");
}
?>
<?php
$colname_Recordset1 = "1";
if (isset($GET['ID'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_connect, $connect);
$query_Recordset1 = sprintf("SELECT * FROM question WHERE ID = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>slide page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function placeAnswer(question_number,ans) {
if (ans == 't')
eval("document.forms[0].question" + question_number).value = <?php echo $row_Recordset1['ID']; ?>+' = correct';
else
eval("document.forms[0].question" + question_number).value = <?php echo $row_Recordset1['ID']; ?>+' = incorrect';
};
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>
<style type="text/css">
<!--
body {
cursor:pointer;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
<body>
<?php
if(isset($POST['submit'])){
$question = $POST['question'];
$questionnum = $POST['questionnum'];
print "$questionnum";
print 'Answer for question' . $questionnum . 'has been recorded - Click on another structure to continue';
} else {
echo "<form action = 'slide.php' method='post'>";
echo "<div align=\'left\'> {$row_Recordset1['Title']} <br>";
echo "<img src={$row_Recordset1['ImageLink']} border='0' usemap='#thirdcleavage'>";
echo "<map name='thirdcleavage' id='thirdcleavage'>";
echo "<area shape='poly' coords= {$row_Recordset1['Map']} href='javascript:placeAnswer('1','t');'>";
echo "<area shape='rectangle' coords='0,-1,1000,999' href='javascript:placeAnswer('1','f');'>";
echo "</map>";
print "{$row_Recordset1['Text']} <br />";
print "<input name='question' type='text' id='question1'>";
echo "<input name='questionnum' type='hidden' id='questionnum' value={$row_Recordset1['ID']}> </div>";
echo "<input name='Submit' type='submit' value='Submit your answer'>";
echo "</form>";
?>
<p>
<?php
print_r($SESSION['thequestion']);
mysql_free_result($Recordset1);
?>
</p>
</body>
</html>
Thanks for looking at this.
Ivan Gepner
gepner@monmouth.edu