trq Posted April 6, 2006 Share Posted April 6, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]no luk is it anythig to do with md5?[/quote]Could be a number of things. You might need to manually view the differences and see.[code]<?php $pass = md5("PUTYOURPASSHERE"); $user = "PUTUSERNAMEHERE"; $result = mysql_query("SELECT `password` FROM band WHERE `username` = '$user'"; if ($result) { $row = mysql_fetech_assoc($result); echo "password from db = {$row['password']}</ br>"; echo "md5'd password given = $pass</br >"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/6670-need-hellp-this-is-a-private-convo/page/2/#findComment-24566 Share on other sites More sharing options...
stefpretty Posted April 6, 2006 Author Share Posted April 6, 2006 right tht was tres helpful! however i relaised at first my storage space ofr passwords was to short so thts why it didnt match but i increased storage size and get this now but logging in still dont work ill paste m y most recent cod i got this too btw... [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]password from db = 5d3e010eb98f9eaf295662fd60773c04md5'd password given = 5d3e010eb98f9eaf295662fd60773c04[/quote]recent login script:[code]<?php session_start(); include ('db.php'); if (!empty($POST['user']) && !empty($_POST['pass'])) { $user = trim($_POST['user']); $pass = md5($_POST['pass']); } else { $error = "Invalid Username or Password"; echo $error; include ('login.html');exit(); } $sql = "SELECT * FROM band WHERE username = '$user' AND `password` = '$pass'"; $result = mysql_query($sql) or die(mysql_error()); if ($result) { $user = mysql_fetch_assoc($result); $_SESSION['userid'] = $user['id']; $_SESSION['username'] = $user['username']; $_SESSION['email']= $user['email']; $_SESSION['prov'] = $user['prov']; $_SESSION['name'] = $user['name']; $_SESSION['style'] = $user['style']; $_SESSION['hist'] = $user['hist']; $_SESSION['infl'] = $user['infl']; $_SESSION['open'] = $user['open']; $_SESSION['photo'] = $user['photo']; $_SESSION['webs'] = $user['webs']; echo "<html><head><title>Welcome Back</title></head><body>Welcome back ".$_SESSION['name']." <a href=\"settings.php\">Click here</a> to view your current settings.</body></html>"; } else { $error = "Invalid Username or Password"; echo $error; include 'login.html';exit(); } ?>[/code] Link to comment https://forums.phpfreaks.com/topic/6670-need-hellp-this-is-a-private-convo/page/2/#findComment-24577 Share on other sites More sharing options...
stefpretty Posted April 6, 2006 Author Share Posted April 6, 2006 HAHAHA forgot this.... oops [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]if (!empty[!--coloro:red--][span style=\"color:red\"][!--/coloro--]($POS[!--colorc--][/span][!--/colorc--]T['user']) [/quote] the under slash!!! sorted now thaks for all your help for the now!!! lol till i hit another problem making this site!!! Link to comment https://forums.phpfreaks.com/topic/6670-need-hellp-this-is-a-private-convo/page/2/#findComment-24582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.