------------------------------- FILE: 1 -> stud.php -------------------------
OK! Well, the first file has the form in which the user inputs the details!
The second file verifies if the details exist on the database!
The third file is just for going on...But i need the details inputed from the 1st file to the 3rd file so can do some other select. However, the values do not pass and although i tried the session_start().
If i dont use the mysql statements then its ok i can access them.
NOTE: i have erased some lines in order ot be less confusing...thanks
<?php
require ('main.php');
$urn = $_POST['urn'];
?>
<form class = "myform" action="conf.php" method="POST">
<div style = "position:relative; top:0%; left:35">
<font size = "4"><b> Please Log In by inserting your URN number and last name </b></font><br><br>
<table border="1" cellpadding="7" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600" id="AutoNumber1">
<tr>
<td align = "right" width = "16%"> URN: </td>
<td width = "84%"><input class = "input" type = "text" name = "urn" value = "<?echo $_POST['urn'];?>" maxlength = "7">
<font color ="red"> * </font><i><font size = "2"> URN must be exactly 7 characters long </i></font></td>
</tr>
........
</table>
</div>
</form>
<?php
$page -> Display2();
?>
----------------------FILE 2: -> conf.php----------------------------------
<?php
$urn = $_POST['urn'];
require ('main.php');
$mysql = new mysqli('localhost', 'root', '323232');
if(!$mysql)
{
echo 'Cannot connect to database.';
exit;
}
// select the appropriate database
$selected = mysqli_select_db( $mysql, 'project' );
if(!$selected)
{
echo 'Cannot select database.';
exit;
}
// query the database to see if there is a record which matches
$query = "select stud_id, stud_lname from student where
stud_fname = '$fname' and
stud_id = '$urn' and
stud_lname = '$pass'";
$result = mysqli_query( $mysql, $query );
if(!$result)
{
echo 'Cannot run query.';
exit;
}
$row = mysqli_fetch_row( $result );
$count = $row[0];
if ( $count > 0 )
{
?>
<p> Welcome Mr/s <strong><? echo $_POST['fname']?>, <? echo $_POST['pass']?></strong><br> Your URN and last name exists on our database </p>
<form action="intop.php" method="POST">
<div style = "width:15em; font-size:22; position:relative; top:5%; left:37% ">
<fieldset><legend> Please Choose: </legend><br>
<input type="radio" name="url" value="intop.php">Select Topics<br><br>
<input type="radio" name="url" value="insuper.php">Select Supervisor<br><br>
<input class = "button" type="submit" name="submit" value="submit">
</fieldset>
</div>
</form>
<?php
}
else
{
echo '<p><strong> Your URN and/or last name do no exist on database </strong></p>';
echo '<p><strong><a href = stud.php>Please try again</strong></a></p>';
//header('location: ' . 'rej.php');
//exit();
}
$page -> Display2();
?>
----------------------------FILE 3: intop.php---------------------------------
<?php
session_start();
require ('main.php');
$page = new homePage();
$page -> content = '<p class = "content"> Please Select 5 Topics </p>';
$page -> Display();
?>
<p> Welcome Mr/s <strong><? echo $SESSION["fname"]?>, <? echo $SESSION["pass"]?></strong><br> Your URN and last name exists on our database </p>
<p> YOU MUST SELECT 5 TOPICS MATE DETAILSSSS OH HOW WHY WHEN <BR>
ASGASGASFGASFGASG
<BR>SAGSAGASFGASFG
<BR>..........
<BR>....................</P>
<form method = "post" action = "seltopic.php">
<p><input class = "button" type="submit" value="Click to Enter"> </p>
<?php
$page -> Display2();
?>