2004-11-30 23:18:35 +00:00
|
|
|
<?
|
|
|
|
require("common.inc.php");
|
|
|
|
|
|
|
|
//authenticate based on email address and registration number from the SESSION
|
|
|
|
if(!$_SESSION['email'])
|
|
|
|
{
|
|
|
|
header("Location: register_participants.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if(!$_SESSION['registration_number'])
|
|
|
|
{
|
|
|
|
header("Location: register_participants.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.name FROM registrations,students ".
|
|
|
|
"WHERE students.email='".$_SESSION['email']."' ".
|
|
|
|
"AND registrations.num='".$_SESSION['registration_number']."' ".
|
|
|
|
"AND registrations.id='".$_SESSION['registration_id']."' ".
|
|
|
|
"AND students.registrations_id=registrations.id ".
|
|
|
|
"AND registrations.year=".$config['FAIRYEAR']." ".
|
|
|
|
"AND students.year=".$config['FAIRYEAR']);
|
2004-11-30 23:38:13 +00:00
|
|
|
echo mysql_error();
|
2004-11-30 23:18:35 +00:00
|
|
|
|
|
|
|
if(mysql_num_rows($q)==0)
|
|
|
|
{
|
2004-11-30 23:38:13 +00:00
|
|
|
echo "error";
|
|
|
|
// header("Location: register_participants.php");
|
2004-11-30 23:18:35 +00:00
|
|
|
exit;
|
|
|
|
|
|
|
|
}
|
|
|
|
$r=mysql_fetch_object($q);
|
|
|
|
send_header("Participant Registration");
|
2004-11-30 23:38:13 +00:00
|
|
|
echo "Welcome back <b>$r->name</b>";
|
|
|
|
echo "<br><br>";
|
2004-11-30 23:18:35 +00:00
|
|
|
print_r($r);
|
|
|
|
|
|
|
|
|
|
|
|
send_footer();
|
|
|
|
?>
|