View Single Post
Old 03-28-2009, 03:50 PM   #17 (permalink)
CrazeD
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,691

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

Personally, I like to use flow control for the entire section that I want protected.

For example;

PHP Code:
<?php

session_start
();

if (isset (
$_SESSION['logged'])) {
     
// do logged in stuff
} else {
     
// not logged in
     
header('location: login/main_login.html');
}

?>
Since the header() function just sends headers to the browser, there is probably a way to block or manipulate that data (though, I'm just guessing here) so if that were the case, your script offers no protection. My script displays the logged in stuff ONLY if they are logged in.

Remember that when you are making scripts such as these, always code as if every user is a malicious user and will attempt to use the script in ways you didn't intend.
__________________

Need website help? PM me!
CrazeD is online now