How do I do this..
I know I´ve posted this
Issue about 2-3 times before
here, and alot of you guys
have tried to help me..
But it still doesnt work.
Right now, my script looks like this:
(((INDEX.php <- the Login page)))
<?php
if (!isset($doCheck)) {
?>
<head><title>Login</title></head>
<body>
<form method="post" action= <? echo "$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("blabla" , "blabla" , "");
sybase_select_db("blabla");
$sql = sybase_query("SELECT Login, Password from anvaendare WHERE Login = '$name' AND Password = '$passwd'");
$result = $sql;
$num_of_rows = @sybase_num_rows($result);
if ($num_of_rows < 1) {
print "<H1>Sorry, wrong username and password</H1>";
sybase_close();
exit();
} else {
}
sybase_close();
header("Location: val.php");
}
?>
(((And my val.php <- The sequred page)))
<?php
if ($submit) {
if ($REQUEST_METHOD != 'POST') {
?>
<head><title>Inloggad</title></head>
<body>
<h2>Vad vill du göra?</h2><p>
<a href="komm.htm">Mata</a> in ett kommando till DB?<br>
<a href="store.php">Infoga</a> en fil till DB?<br>
<a href="getdata.php">Mata</a> ut en fil från DB?<br>
<a href="input.php">Skriva</a> in en text till DB?<br>
<?
exit();
}
else {
echo 'Sorry, Illegeal request';
}
}
?>
</body>
Sorry for printing this much in the
Forum!
/Chess