hmmm .... there are quite a few bits needs to be changed, so i will just jot them down again.
change the script to following:
<?php
if (!isset($doCheck))
{
?>
<head><title>Logintest</title></head>
<body>
<form method="post" action= <? $php_self ?>>
<input type="hidden" name="doCheck" value="1">
<input type="textfield" name="name">
<input type="password" name="passwd">
<input type="submit">
</form>
</body>
<? }
else
{
$sybase = sybase_connect("a" , "ab" , "");
sybase_select_db("db");
$sql = sybase_query("SELECT Login, Password from anvaendare WHERE Login = '$name' AND Password = '$passwd'");
$result = sybase_query($sql);
$num_of_rows = @sybase_num_rows($result);
// if num of rows is less than 1 from the
// sql result, then it means no record
// found in db by given username & passwd
if ($num_of_rows < 1) {
print "<H1>Sorry, wrong username and password</H1>";
sybase_close();
exit();
}
else {
sybase_close();
header("Location: goon.htm");
}
}
?>