Greetings,
I am having a problem on retrieving the users firstname after logging in. Here's my code
<HTML>
<BODY>
<?php
session_start();
include ("connectDB.php");
$stud_test_ID = $_POST["testIDtxt"];
$password_Field = $_POST["Passtxt"];
$insertSql = "SELECT firstName FROM testdb WHERE stud_Id = '$stud_test_ID' And Password = '$password_Field'";
$result = $mysqli->query($insertSql);
$numrows = $result->num_rows;
if($numrows==1)
{
echo "record found successfully." . "username: " . $stud_test_ID;
echo " Are you ready for the exam? " . "<a href='math(1).php' > Click here</a>";
$_SESSION['studName'] = $_POST['firstName'];
}
else
{
echo "Invalid Student ID# or Password.";
}
?>
</HTML>
</BODY>
And this is where i display my user's first name.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<header id="head" >
</header>
</head>
<body>
<label>
Examiner's Name:
<?php
session_start();
$_SESSION['studName'];
?>
</label>
<form name="frmMath" action="mathQuestionnaire.php" method="post">
<table align="center" cellpadding="2" cellspacing="2" border="2" style="width:autopx;">
Any help would be appreciated.