I now have another problem my form is not being posted this is the code i have written
it is reaching to the echo 'what the hell' but its not being posted to another form so as to display the data.
Am getting an error on this line of code ..$From=$_POST['vselect'];
Error message is :Undefined index: vselect
Pls assist
Thanks in advance.
<form action="<?php echo $SERVER['PHP_SELF']; ?>" method="post" name="form1">
<label>Plot No</label><input type="text" id="vselect">
<input type="submit" value="Submit" id="submit">
</form>
<?php
$dsn="";
$username="";
$password="";
$sql_connect=odbc_connect($dsn,$username,$password);
if (!isset($POST['vselect']))
{
echo "what the hell";
$From=$POST['vselect'];
echo $From;
//if ($POST['vselect']=="Plot Number")
{
$sql_query="select plotno,plotid,distcode,sectcode,plotusecode,actarea from lms_plot where (LMS_Plot.PlotNo='$From')";
$rs=odbc_exec($sql_connect,$sql_query);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>plotno</th>";
echo "<th>plotid</th>";
echo "<th>distcode</th>";
echo "<th>sectcode</th>";
echo "<th>plotusecode</th>";
echo "<th>actarea</th></tr>";
while (odbc_fetch_row($rs))
{
$plotno=odbc_result($rs,"plotno");
$plotid=odbc_result($rs,"plotid");
$distcode=odbc_result($rs,"distcode");
$sectcode=odbc_result($rs,"sectcode");
$plotusecode=odbc_result($rs,"plotusecode");
$actarea=odbc_result($rs,"actarea");
echo "<tr><td>$plotno</td>";
echo "<td>$plotid</td>";
echo "<td>$distcode</td>";
echo "<td>$sectcode</td>";
echo "<td>$plotusecode</td>";
echo "<td>$actarea</td></tr>";
//echo $plotno;
//echo $plotid;
}
}
}
odbc_close($sql_connect);
echo "</table>";
?>