View Single Post
Old 03-26-2009, 03:05 PM   #13 (permalink)
CrazeD
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,686

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: PHP form password with MD5

Quote:
Originally Posted by murdocsvan View Post
I was also reading about sessions and i read that the old session has been depracated by $_SESSION. I've tried changing it, but i've found i've got a parse error when i request the session on the other pages. No problem with registering it though.

This is the code that gives me an error:

PHP Code:
<?php

session_start
();

if(!isset(
$_SESSION['logged'))
    {
    
header("location:login/main_login.htm");
    }
    
?>
And this is the code that sets the variable on the check_login page:

PHP Code:
if($count==1)
        {
        
// Register $myusername, $mypassword and redirect to file "login_success.php"
        
$_SESSION['logged'] = "yes";
        
header("location:login_success.php");
        }
    else 
        {
        echo 
"Error: Wrong Username or Password";
        } 
Lol it probably isn't very secure.

Thanks in advanced.
I don't see anything that would give an error. Can you post the error you get?

Also, instead of doing $_SESSION['logged'] = "yes", make it a Boolean. $_SESSION['logged'] = true.

Then, when you check for it, do if ($_SESSION['logged'] == true) { //asdfasdf }
__________________

Need website help? PM me!
CrazeD is offline