md5 encryption

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Example : if you are using post method

Code: Select all

PHP: 

<?php 
$enteredPass = $_POST&#1111;'password']; 
// Check to see if input was entered in the password field here 
$correctPass = md5('CORRECTPASSHERE'); 
if (md5($enteredPass) == $correctPass) 
&#123; 
  echo 'Authenticated.'; 
&#125; 
else 
&#123; 
  echo 'Not Authenticated.'; 
&#125; ?>


Abdul Mannan
dmcglone
Forum Newbie
Posts: 20
Joined: Sun Sep 28, 2003 7:54 pm
Location: Columbus, Ohio

Post by dmcglone »

Nay wrote:You mean when you match it with the password that was already encrypted, you don't get a match and it doesn't authenticate?

-Nay
I figured the problem out, I needed to post the password coming from the form as md5 instead of plain text.

I finally grasped the concept of all this and now i've altered most of the code and hooked it up to a database :)

So now I want to take back all my whinning from earlier, because things are starting to get clear in my clouded head. 8O
Post Reply