Hi,
I write a code to check the data in the database, but it is not work ..
First,
I do the form which as
session_start();
$driver_id= $_SESSION['driver_id'];
<form method="POST" action="pay_fines_engine.php">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p>You want to pay for this finesNo <input type="text" name="finesNo" size="20" value="<? echo $finesNo; ?>"></p>
<p> Enter your AccountNo to pay </p>
<p>AccountNo: <input type="text" name="accountNo" size="20"></p>
<p> Insert the date </p>
<p>Date: <input type="text" name="PaymentDate" size="20" value="<?echo Date("Y-n-d") ?>"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
In this form, the driver will write his accountNo which already exist in the driver table ..
and i write engine to check if the accountNo is correct or false ..
& in the bothside the engine accept any accountNo and enter the driver to other other page without checking if the accountNo is correct or not ..
is is the code for the pay_fines_engine.php
session_start();
$SESSION['driver_id']=$driver_id;
$SESSION['accountNo']=$accountNo;
$SESSION['finesNo']=$finesNo;
$SESSION['PaymentDate']=$PaymentDate;
include("connect.php");
include("redirect.php");
$accountNo=$POST['accountNo'];
$finesNo=$POST['finesNo'];
$PaymentDate=$_POST['PaymentDate'];
$sql = "SELECT * FROM driver where driver_id='$driver_id' and accountNo='$accountNo'";
$result= mysql_query($sql) or die ("could not execute query $sql");
if($result==1){// i means here if the both driver_id & accountNo correct enter here
echo "<p> $driver_id </p>";
echo "<p> $licenseNo </p>";
echo "<p> $finesNo </p>";
echo "<p> $PaymentDate </p>";
} else {// otherwise enter here ..
echo "<p> Error </p>";
}
?>
I try several time to make it check the both driver_id and accountNo but it doesn't work ..
Can anyone HELP me please !!