FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


checking password





abhi1982
I have used md5 for password encrypting..

$pass = md5($_POST[$Password]);

now I inserted this encryped value in the database using the insert statement. Now I want to check this value when a user log in. but when the user was trying to login with this same password, it doesn't allow him and says incorrect password.

Thanks in advance
Abhilash Putta
DanielXP
Ok

are you md5ing both posts the one in the db and the post from the login?


and


is your db field big enough to fit the encrypted password in?

try making a little longer and test again.
rohan2kool
most prolly u're not md5ing both values. it has happened many times with me.

as for the other case, varchar(32) works fine for md5 values.
Philip
hehe of course since, the result of md5 is 32 byte/char. Smile
and it is one way hash encrypt, so there is no way to decryp it back Smile
abhi1982
Hey Thanks for the replies. I was not md5ing both the values. Now it works just fine. Also thanks for letting me know what size the data variable.

Thanks once again
Abhi
rohan2kool
Philip wrote:
hehe of course since, the result of md5 is 32 byte/char. Smile


real funny.

Philip wrote:
and it is one way hash encrypt, so there is no way to decryp it back Smile


did anyone ask that?
DanielXP
Welcome abhi1982
abhi1982
Thank you Daniel,

can any one help me writing a script where I have to click a link and it should populate the results in the same page. May be in a text box or on the page itself. I have been trying to find this for the past few days. but couldnt.

Thanks
Abhi.
hexkid
abhi1982 wrote:
click a link and it should populate the results in the same page.


Have fun Smile
Code:
<?php
$data = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten');

$txt = '';
if (isset($_GET['populate'])) {
  $n = (int)$_GET['populate'];
  if ($n < 1) $n = 1;
  while ($n--) {
    foreach ($data as $element) {
      $txt .= $element . ' ';
    }
    $txt .= '<br>';
  }
}

echo 'Click <a href="?populate=7">here</a> to populate:<br><hr>';
echo $txt;
echo '<hr>End of page.';
?>
abhi1982
That looks great,

Now I have learnt how to populate, but is there any reversal for populate.
in the previous example if I click "here" the array will be populated 7 times. Now if i click someother link the populated text should be erased

Thanks
Abhi
hexkid
abhi1982 wrote:
That looks great,

Now I have learnt how to populate, but is there any reversal for populate.
in the previous example if I click "here" the array will be populated 7 times. Now if i click someother link the populated text should be erased

Thanks
Abhi


Code:
// ...
echo 'Click <a href="?populate=7">here</a> to populate ';
echo 'or <a href="?dummy=1">here</a> to clear';
echo '<br><hr>';
// ...
abhi1982
Thanks a lot man, thats awesome. I have been wasting a lot of time for this.

Thanks once again.
Abhi
Related topics
htaccess Password Protection
password problem
Does Frihost's SMTP server require login and password?
HELP! I registered, but never got my confirmation email.
How To : Secure Your PHP Website
Why are no admins helping me?
Password Protecting Directories?
Daddy's Password
how can i change password in my database?
How to bypass your BIOS Password
Strange DSL modem problem
php+mysql password / login screen
Checking if input fields actually have input?
Two validations process
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.