(1) first file is fill.php and i am using a second file search.php, i pass parameters from fill.php to search.php , but i am getting an error i am getting unexpected t_variable error in line 16 in search.php
fill.php
<?php
?>
<html>
<body>
<form action="search.php" method="post">
<table style="color:purple;border-style:groove; height:150px;width:350px" >
<tr>
<td style=" height:25px; font-family:'Copperplate Gothic
Bold'"> </td>
</tr>
<tr>
<td style="color:red;background-color:aqua;height:25px">Enter Employee id
<input name="name" id="name" type="text"/></td>
</tr>
<tr>
<td style="height:25px">
<input type="submit" value="Submit" style="color:white;background-color:brown; height:30px" /></td>
</tr>
</table>
</form>
</body>
</html>
Search.php
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ravi", $con);
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mysql", $con);
$name = (int)$_post['name']
$sql = "SELECT * from empmast where empid= $name";
$result = mysql_query($sql);
if (!$result)
{
die("Error running $sql: " . mysql_error());
}
while($rowval = mysql_fetch_array($result))
{
$empid= $rowval['empid'];
$empname= $rowval['empname'];
}
mysql_close($con);
?>