PHP Login script
Posted: Wed Jan 14, 2004 11:56 am
<form method="post" action="process.php">
Username
<input type="text" name="user" />
<br />
Password
<input type="password" name="pass" />
<br />
<input type="submit" name="submit" value="Login" />
</form>
<?
//get variables from login screen.mdb
$user = $_POST['user'];
$pass = $_POST['pass'];
if (odbc_num_rows($query)) {
header("Location: process.php");
exit();
} else {
echo "you can't log in.";
}
?>
I have done the process PHP but how can i validate users? When i run the code it comes up with the following errors:
Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in c:\phpdev5\www\tmpa3fcbrhqz1.php on line 15
you can't log in.
where am i going wrong?
Username
<input type="text" name="user" />
<br />
Password
<input type="password" name="pass" />
<br />
<input type="submit" name="submit" value="Login" />
</form>
<?
//get variables from login screen.mdb
$user = $_POST['user'];
$pass = $_POST['pass'];
if (odbc_num_rows($query)) {
header("Location: process.php");
exit();
} else {
echo "you can't log in.";
}
?>
I have done the process PHP but how can i validate users? When i run the code it comes up with the following errors:
Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in c:\phpdev5\www\tmpa3fcbrhqz1.php on line 15
you can't log in.
where am i going wrong?