anyways here is my question:
I have an html form(name and password) form is posted to a PHP file, where i check the nam/password against my database. I want to be able to go back to login.html if user name does not exist or go to my main page if user login is successful? any idea how i can do that?
here is my code:
.....login.html......
<FORM action="validate.php" method="POST" name="frmLogin">
Login Name<BR>
<INPUT type="text" name="Name"></INPUT>
Password<BR>
<INPUT type="password" name="Password"></INPUT>
<INPUT type="submit" value="Login" ></INPUT>
</FORM>
.....validate.php......
<?php
//...search USER_INFO table for name and password...//
$query = "SELECT NAME, PASSWORD FROM USER_INFO WHERE NAME='$name' AND PASSWORD='$password'";
$result = pg_exec($connection, $query);
if (!$result) {
printf ("ERROR");
$errormessage = pg_errormessage($connection);
echo $errormessage;
.....here it should go back to login.html.....
exit;
}
$numrows = pg_numrows($result);
if($numrows < 1)
{
echo "No Data!";
.....here it should go back to login.html.....
exit;
}
.....here it should go to my main page.....
pgsql.pg_close();
?>
thank you for your help....
F