PHP admin log on thingy?

Cool, thought i'd changed that but I hadnt saved before uploading.

Excuse me for being dumb but which of the 'username' and 'passwords' do I need to change?
 

Code:
<?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>';
        }
}
?>

See above where I've written (do I change this). pls dont hate me! :(
 
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. :)
 
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?
 
Umm, it doesnt. I can clearly see what I'm typing as I type it :(

look at the input type.

<input type="text" name="username">
<input type="password" name="password">

check all my posts above and going back to the other thread i linked to, the input type is set correctly.

if you're hosting the page online, let me see it.
 
Back
Top Bottom