I am sorry about the caps....i was tring to figure out the way to do it and i didnt notice it. Sorry mate
well i have this code:
Once the top1 is verified that it exists on the database...the link goes to conftopic.php which i want to display the top1 inserted by the user....You told me to use _SESSION...well how do i use it?
Thank you
<?php
ob_start();
require ('main.php');
$page = new homePage();
$page -> content = '<p class = "content"> Student Registry </p> <br><br><br><br> ';
$page -> Display();
$top1 = $_POST['top1'];
if(!isset($top1))
{
$error_msg.="Please enter your<br>";
?>
<form class = "myform" action="" method="POST">
<div style = "position:relative; top:0%; left:35">
<font size = "4"><b> Please fill out the form </b></font><br><br>
<table border="1" cellpadding="7" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600" id="AutoNumber1">
<tr>
<td rowspan = "4" width = "20%"><strong>Project Topic 1</strong></td>
</tr>
<tr>
<td align = "right" width = "30%"> Topic Name: </td>
<td width = "50%"><input class = "input" type = "text" name = "top1" value = "<?echo $_POST['top1'];?>" maxlength = "100" size = "50"></td>
</tr>
<tr>
<td colspan = "4" align = "center"><input class = "button" type="submit" name="subButton" value=" > Register < "></td>
</tr>
</table>
</div>
</form>
<?php
}
else
{
$mysql = new mysqli('localhost', 'root', '323232');
if(!$mysql)
{
echo 'Cannot connect to database.';
exit;
}
$selected = mysqli_select_db( $mysql, 'project' );
if(!$selected)
{
echo 'Cannot select database.';
exit;
}
$query = "select count(*) from topic where
top_name = '$top1'";
$result = mysqli_query( $mysql, $query );
if(!$result)
{
echo 'Cannot run query.';
exit;
}
$row = mysqli_fetch_row( $result );
$count = $row[0];
if ( $count > 0)
{
header('location: ' . 'conftopic.php');
exit();
}
else
{
//echo 'no';
header('location: ' . 'rejtopic.php');
exit();
}
}
//$page -> Display2();
ob_end_flush();
?>