<?php
session_start();
mysql_connect('localhost', 'mark1e', '*******');
mysql_select_db('mark1e);
function clean($value) {
if(get_magic_quotes_gpc()) $value = stripslashes($value);
return trim(mysql_real_escape_string($value));
}
if($_POST['login'] && $_POST['do i change this?'] && $_POST['do i change this]) {
$username = clean($_POST['do i change this']);
$password = md5($_POST['do i change this']);
$result = mysql_query("SELECT username FROM admin WHERE username = '$username' AND password = '$password'");
if(mysql_num_rows($result) == 1) {
$_SESSION['do i change this'] = $username;
header("Location: admin.php");
exit;
} else {
$error = '<p>sorry, wrong username/password.</p>';
}
}
?>
no don't change those. they have to match the names they are given in the form
<input type="text" name="username"> corresponds with $_POST['username']
etc
i already told you the only thing you have to change is the table/column names in the sql query if it doesn't match your setup.![]()
Cool,
one more and I think I'm done
What reference does the if($_POST['login'] have?
short memory? what did i just say about $_POST variables corresponding to an input name on the form?![]()
The button?
Marc, how can I make it so that the password I enter in the HTML form appears as an Asterix (*)?
Thanks
have a gold star.
it already does.
Umm, it doesnt. I can clearly see what I'm typing as I type it![]()