Hey guys! I have tried my best but couldnt fix this thing.
data passes from another form to this page but problem is the data is going nowhere. instead i am getting data cannot be added message i defined below. Please Help me out
<html>
<title>Main Page HMS</title>
<body>
<table width='679' border='0'>
<tr>
<th height='94' colspan='2' scope='col'><img src='hmsh.gif' width='963' height='177'></th>
</tr>
<tr>
<th height='21' colspan='2' scope='col'><?php include("toolbar.php"); ?></th>
</tr>
<tr>
<th width="189" height='191' valign="top" scope='col'><?php include("menu.php"); ?></th>
<th width="770" height='191' valign="top" scope='col'><table width="100%" border="0">
<tr>
<td bgcolor="#BAC5D9">New Internal Patient Information</td>
</tr>
</table>
<p align='left'><?php if($session->logged_in)
{
$tbl="opd";
$vdate=date("d/m/y h:i:s");
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$age=$_POST['age'];
$gen=$_POST['gen'];
$phno=$_POST['phno'];
$prvisit=$_POST['prvisit'];
$mstatus=$_POST['mstatus'];
$city=$_POST['city'];
$docid=$_POST['docid'];
$sql = "INSERT INTO $tbl (`fname` ,`lname` ,`age` ,`gen` ,`mstatus` ,`phno` ,`city` ,`prvisit` ,`docid` ,`vdate` )
VALUES ('$fname', '$lname', '$age', '$gen','$mstatus', '$phno','$city', '$prvisit', '$docid','$vdate')";
$result=mysql_query($sql);
if($result)
{
echo $fname." has been added to ".$tbl." successfuly";
}
else {echo"Data Cannot be added Added";}
}
else
{
echo "you are not logged in. "; } ?>
</p>
<p></p></td>
</tr></th>
</tr>
</table>
</body>
</html>