urs_umar86 wrote:
> i am new in php know i want to make a login page is there any easy way 
> to create a login page and tell me the way by using dreamweaver how can 
> i make the login page.
> Thanks in advance.


Dreamweaver does not write PHP code for you. You can use it to create 
the input form but that is about it ...

As far as login forms, make sure you read up on input validation and the 
PROPER use of escape functions. Use mysql_real_escape_string() instead 
of addslashes()

Here is how I implemented my login form.

1) Database keeps username and password, password is saved as md5sum
2) User enters Username and password, I take the username and make it 
save for use in mysql via mysql_real_escape_string() Now I turn the 
entered password into an md5sum.
3) Get users from database with the username entered, there should only 
be one.... now compare the password hash from the database to the hash 
you created from the provided user password.
4) If the password entered matches the password in the database I 
generate a session ID, this ID is stored in the login table with 
originating IP, Browser ID string and Date/Time of login.
5) Now I add the SSID to forms and links to keep the user logged in, 
every time the user does something I compare the SSID, IP, Browser 
String to the values in the login table, if they match I update 
Date/Time to NOW() which will keep the user logged in. If something does 
not match or if the user account has expired (based on the Date/Time 
stored) the user is kicked out and a login is forced.

In addition to the above, you should also implement cookie based 
validation to ensure nobody steals the SSID string and takes over the 
session.

Since you are new to PHP, the above may be to complicated but I don't 
know your programing / database background.

John

Reply via email to