Login Register


Login filter_list
Author
Message
Login #1
Does this Verify.php Look fine, Anything I need to add to it?

Code:
<?php if(isset($_POST['submit'])){ $dbHost = "localhost"; //Location Of Database usually its localhost $dbUser = "xxxx"; //Database User Name $dbPass = "xxxxxx"; //Database Password $dbDatabase = "db_name"; //Database Name $db = mysql_connect($dbHost,$dbUser,$dbPass)or die("Error connecting to database."); //Connect to the databasse mysql_select_db($dbDatabase, $db)or die("Couldn't select the database."); $usr = mysql_real_escape_string($_POST['username']); $pas = hash('sha256', mysql_real_escape_string($_POST['password'])); $sql = mysql_query("SELECT * FROM users_table WHERE username='$usr' AND password='$pas' LIMIT 1"); if(mysql_num_rows($sql) == 1){ $row = mysql_fetch_array($sql); session_start(); $_SESSION['username'] = $row['username']; $_SESSION['fname'] = $row['first_name']; $_SESSION['lname'] = $row['last_name']; $_SESSION['logged'] = TRUE; header("Location: users_page.php"); // Modify to go to the page you would like exit; }else{ header("Location: login_page.php"); exit; } ?>







Reply





Messages In This Thread
Login - by BlueCat - 05-23-2014, 09:07 PM



Users browsing this thread: 1 Guest(s)