Problem with PHP/MySql
#2

This?

Код:
 <?php
session_start();
if(isset($_POST['login'])){
	if($_POST['user'] && $_POST['password']){
 	    include ("variables.php");
    	    $connection = mysql_connect ($dbservername, $dbusername, $dbpassword);
    	    mysql_select_db($dbname, $connection);

    	    if (!isset($_SESSION["username"]))
    	    {
        	$username = mysql_escape_string($_POST["user"]);
        	$password = mysql_escape_string($_POST["password"]);
    	     }
	     else $username = mysql_escape_string($_SESSION["username"]);

		....
	}
       else{
             echo "There was no values for username or password posted!!";
       }

}

....

?>
You can also use it hash("sha512"..) or MD5 to have your peace of mind from hacks accounts.
Reply


Messages In This Thread
Problem with PHP/MySql - by dudu.r.oliveira - 14.06.2015, 19:37
Re: Problem with PHP/MySql - by FplayerGR - 15.06.2015, 08:44
Re: Problem with PHP/MySql - by mamorunl - 15.06.2015, 08:58

Forum Jump:


Users browsing this thread: 2 Guest(s)