login code error

i get an error at if (isset($_POST[‘student_number’]) && isset($_POST[‘student_password’)) {

and at } else {

im not sure wats wrong can anyone help?

[php]<?php

if (isset($_POST[‘student_number’]) && isset($_POST[‘student_password’)) {

  if (($_POST['username'] == $user) && ($_POST['password'] == $pass)) {    
    
    if (isset($_POST['rememberme'])) {
        /* Set cookie to last 1 year */
        setcookie('username', $_POST['username'], time()+60*60*24*365, '/account', 'www.example.com');
        setcookie('password', md5($_POST['password']), time()+60*60*24*365, '/account', 'www.example.com');
    
    } else {
        /* Cookie expires when browser closes */
        setcookie('username', $_POST['username'], false, '/account', 'www.example.com');
        setcookie('password', md5($_POST['password']), false, '/account', 'www.example.com');
    }
    header('Location: index.php');
    
} else {
    echo 'Username/Password Invalid';
}

} else {
echo ‘You must supply a username and password.’;
}

?>[/php]

never mind i got it :smiley:

hello thagrimreaper,

can you post error you are getting? So according to that i can provide suggetion or answer.
Also post your form wher you fill up the detail.

SR

im using dreamweaver to edit the files, i like how i can easly swap between code and desgin

but dream weaver doesnt tell u wats wrong with the code only theres a syntax error, i worked it out i was missing a ] after tudent_password’))

Sponsor our Newsletter | Privacy Policy | Terms of Service