help! Login script for website

Experienced Elementalist
Joined
Apr 2, 2009
Messages
281
Reaction score
23
I want to make login script for website that connects to mssql with md5 hash and idk what to start of with so can anyone teach me how to make one?

Thank you.
 
Just posted something like this here: [ame=http://www.habboxforum.com/showthread.php?t=646999]Basic PHP+MySQL Login System (example code)[/ame]
 
i was looking for mssql(microsoft sql) but oh well i will learn from it thx alot for giving me the link. Hope i can be able to create my own login script. Thank You again.
 
A neat thing to do with your login script is to make sure that if the visitor only types in the username and perhaps accidently presses login, it will go "You forgot to type in the password", but also fill in the username again, from what the user entered previously so that the user won't have to do that once again. If you kind of understand what I'm trying to say, I can't explain if my life depended on it.
 
A neat thing to do with your login script is to make sure that if the visitor only types in the username and perhaps accidently presses login, it will go "You forgot to type in the password", but also fill in the username again, from what the user entered previously so that the user won't have to do that once again. If you kind of understand what I'm trying to say, I can't explain if my life depended on it.

Basically your trying to say that if you login in but mess up or forget to enter the password, when the page refreshs telling you so, the username previously entered is still there and doesn't need to be RE entered.

This can be done by sessions..
PHP:
<?php
session_start();

$_SESSION['userName'] = $_POST['USER_NAME_POST']; //this sets a sesion containing the value inserted into the username form
?>

then.. in your form..

Code:
<input type="text" name="username" value="<?php echo $_SESSION['userName'];?>">

The above sets the text field too the username session created on the first login attempt.. if its your first time to the page it will just be blank.

Or insert this into your form..

PHP:
<?php
if(isset($_SESSION['userName'])){
$username = $_SESSION['userName'];
}else{
$username = "Enter username..";
}
?>

-AND-

<input type="text" name="username" value="<?php echo $username; ?>">
 
Back