Similar topics
Pencarian
translator
User Yang Sedang Online
Total 59 uses online :: 0 Terdaftar, 0 Tersembunyi dan 59 Tamu Tidak ada
User online terbanyak adalah 292 pada Mon Oct 28, 2024 9:51 pm
Encrypting Password
Halaman 1 dari 1
Encrypting Password
Syntax | |
<table border="0" cellpadding="0" cellspacing="5" width="100%"> <tr> <td> $password="123456"; md5($password); Use md5(); to encrypts password to make it more secure </td> </tr> </table> |
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="3" width="100%"> <tr> <td><table bgcolor="#f4f9fb" border="0" cellpadding="0" cellspacing="1" width="100%"> <tr> <td width="1%"> </td> <td width="99%" height="20">Overview</td> </tr> <tr> <td colspan="2" bgcolor="#eeeeee"></td> </tr> <tr> <td colspan="2" valign="top"><table border="0" cellpadding="0" cellspacing="5" width="100%"> <tr> <td>Look at these two databases, it's the same person and same info, the first one we don't encrypt his password but the second one we encrypted his password </td> </tr> <tr> <td align="center"><table bgcolor="#cccccc" border="0" cellpadding="0" cellspacing="1" width="100"> <tr> <td></td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> <tr> <td>when you encryte "john856" using this code, you'll see this result "ad65d5054042fda44ba3fdc97cee80c6" This is not a random result, everytime you encrypt the same password you will get the same result. $password="john856"; $encrypt_password=md5($password); echo $encrypt_password; </td> </tr> </table></td> </tr> </table></td> </tr> </table> |
Example - Login | |
<table border="0" cellpadding="0" cellspacing="5" width="100%"> <tr> <td> This is an example Login with encrypted password but don't forget to encrypt password and insert into database in sign up process. // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // encrypt password $encrypted_mypassword=md5($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$encrypted_mypassword'"; $result=mysql_query($sql);</td></tr></table> |
Halaman 1 dari 1
Permissions in this forum:
Anda tidak dapat menjawab topik