adam291086 Posted November 23, 2007 Share Posted November 23, 2007 hey I followed a tutorial to create a login script. When i set the table up i set password to = PASSWORD and this encrypts all password in there. How do i go about returning the correct value of the password and not the encrypted on. The code below is what i have so far and it return the encrpted password <?php session_start(); // is the one accessing this page logged in or not? if (!isset($_SESSION['db_is_logged_in']) || $_SESSION['db_is_logged_in'] !== true) { // not logged in, move to login page header('Location: login.php'); exit; } include 'config.php'; //button stuff $search = $_SESSION['username']; $result = mysql_query("SELECT * FROM tbl_auth_user WHERE user_id ='$search' ") or die(mysql_error()); while($row = mysql_fetch_array($result)) { $home = $row['Home page']; $ryedale= $row['Ryedale Rumble']; $adam= $row['Adam']; $id = $row['user_id']; $password = $row['user_password']; } // user info echo $id; echo $password; echo $home; echo $ryedale; echo $adam; include 'closedb.php'; Link to comment https://forums.phpfreaks.com/topic/78558-solved-encrypted-password-return/ Share on other sites More sharing options...
revraz Posted November 23, 2007 Share Posted November 23, 2007 There is no reason to return the original password and there is also no way to. Everytime you want to verify a pw, you encrypt it first then compare, then if it matches it succeeds. Link to comment https://forums.phpfreaks.com/topic/78558-solved-encrypted-password-return/#findComment-397524 Share on other sites More sharing options...
adam291086 Posted November 23, 2007 Author Share Posted November 23, 2007 oh didn't realise that. I am just breaking the code and fixing it to learn how it works. Plus adding in other functions. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/78558-solved-encrypted-password-return/#findComment-397525 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.