News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Problem whit MD5

Started by [darksteel], June 17, 2005, 08:27:41 PM

Previous topic - Next topic

[darksteel]


// This passwors was insert into USUARIOS

$pass = md5(123456);

$x=mysql_query("select * from usuarios");
     while($row=mysql_fetch_array($x)){

if($pass == md5($row[passwd])){
echo'Perfect Passwd';
}
else{
echo' Invalid Passwd ';
}

}


This code in .php show Invalid Passwd  :-X. I don't use md5 whit php&mysql.

darksteel-



Luis "[darksteel]" Alvarado.
Spanish Support
¿Qué es el repair_settings?
No doy soporte por PM, publica tu duda en el foro y tendras respuestas mas rapidas.
My forum:
www.caamboard.com

[Unknown]

Are you md5'ing the passwords within the database?  If not, you should be.

-[Unknown]

[darksteel]

Quote from: [Unknown] on June 17, 2005, 11:24:57 PM
Are you md5'ing the passwords within the database?  If not, you should be.

-[Unknown]

Yes I put the pass in md5 into the database,
Quotenombre      passwd
         darksteel     f890b5b5d852261faae6

When I use the code to verify the password's show else message.


if(isset($_GET[verificar])){

$x=mysql_query("select * from usuarios");
     while($row=mysql_fetch_array($x)){
      $nombreve = $_POST[nombreve];
  $passwdve = md5($_POST[passwdve]);


if($nombreve == $row[nombre] || $passwdve == $row[passwd]){

echo' todo correcto ';}else{echo' nada correcto';}
}

}
         
          echo' Verificar<br> <form name="form" action="?verificar" method="post">
                <b>Nombre:</b>
                <td width="85%">
                <input type="text" size="25" name="nombreve" malength="100">
                <b>Passwd:</b>
<td width="85%">
                <input type="text" size="25" name="passwdve" malength="100">
<input type="submit" value="Enviar datos" name="enviar">
</form>';


The code is one example verify the data.... and show error.

darksteel-



Luis "[darksteel]" Alvarado.
Spanish Support
¿Qué es el repair_settings?
No doy soporte por PM, publica tu duda en el foro y tendras respuestas mas rapidas.
My forum:
www.caamboard.com

[Unknown]


// This passwors was insert into USUARIOS

$pass = md5('123456');

$x=mysql_query("select * from usuarios");
     while($row=mysql_fetch_array($x)){

if($pass == $row[passwd]){
echo'Perfect Passwd';
}
else{
echo' Invalid Passwd ';
}

}


-[Unknown]

Advertisement: