Q:

security issues in Login registration system using php javascript mysql

I am building a web application from scratch that has registration and login functionality.  I am completely a novice when it comes to security issues and attack like mysql injection.  Apart from encryption of password in database, what are other security issues that i have to worry about??  And how do i take care of them?? 
Thank you

A:

You need to make sure to sanitize all variables in your SQL, if you're not using something like PDO this is done most easily with mysql_real_escape_string
For example, when you are checking a users credentials your code would look something like:
$sql = "SELECT `id` FROM `users` WHERE `username` = '".mysql_real_escape_string($_POST['username'])."'  AND `password` = '".mysql_real_escape_string($_POST['password'])."'"; 
$dosql = mysql_query($sql); // etc

It's also worth adding the following to your login routine to prevent session fixation.  
session_regenerate_id(true);

