Login working, but not cookie.
This commit is contained in:
parent
ed0efd68a9
commit
21a833a3eb
@ -1,4 +1,4 @@
|
|||||||
<form action="login.php" method="post">
|
<form action="<?php echo $_SERVER[REQUEST_URI]; ?>" method="post">
|
||||||
<input type="hidden" name="do" value="authenticate">
|
<input type="hidden" name="do" value="authenticate">
|
||||||
|
|
||||||
<table border=0>
|
<table border=0>
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Login</title>
|
|
||||||
</head>
|
|
||||||
<?php
|
|
||||||
if ( $_POST['do'] == "authenticate") {
|
|
||||||
# require "../includes/config.php";
|
|
||||||
require "../includes/dbconnect.php";
|
|
||||||
|
|
||||||
$sql = "SELECT id FROM users WHERE username='$_POST[username]' and password=PASSWORD('$_POST[password]')";
|
|
||||||
$result = mysql_query($sql) or die (mysql_error());
|
|
||||||
|
|
||||||
echo mysql_num_rows($result);
|
|
||||||
|
|
||||||
if (mysql_num_rows($result) == 1) {
|
|
||||||
echo "<p>You are a valid user!<br />";
|
|
||||||
echo "Your username is $_POST[username]<br />";
|
|
||||||
echo "Your password is $_POST[password]</p>";
|
|
||||||
include("login_form.inc");
|
|
||||||
} else {
|
|
||||||
unset($_POST['do']);
|
|
||||||
echo "<p>You are not authorized. Please try again.</p>";
|
|
||||||
include("login_form.inc");
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
include("login_form.inc");
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||||||
<form action="login.php" method="post">
|
|
||||||
<input type="hidden" name="do" value="authenticate">
|
|
||||||
|
|
||||||
<table border=0>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Username</strong></td>
|
|
||||||
<td><input type="text" name="username" size="20" maxlength="20"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><strong>Password</strong></td>
|
|
||||||
<td><input type="text" name="password" size="20" maxlength="20"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan=2 align="center"><input type="submit" value="Login"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require "../includes/htmlcode.php";
|
require "../includes/htmlcode.php";
|
||||||
start_html("Create new post");
|
start_html("Create new post");
|
||||||
|
include "../includes/login.inc";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h1>Create new post</h1>
|
<h1>Create new post</h1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user