Jump to content

Archived

This topic is now archived and is closed to further replies.

stefpretty

NEED hellp this is a private convo!

Recommended Posts

[!--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]

Share this post


Link to post
Share on other sites
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 = 5d3e010eb98f9eaf295662fd60773c04
md5'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]

Share this post


Link to post
Share on other sites
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!!!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.