View Single Post
Old 03-26-2009, 07:16 AM   #12 (permalink)
murdocsvan
murdocsvan's Avatar
 
Ultra Techie

Join Date: Jun 2007

Location: Surrey, UK

Posts: 849

murdocsvan is on a distinguished road

Default Re: PHP form password with MD5

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.
__________________

murdocsvan is offline