Welcome To SMK TI PEMBANGUNAN
Sebelum Masuk Forum , Log in terlebih dahulu
Pencarian
 
 

Display results as :
 


Rechercher Advanced Search

translator

User Yang Sedang Online
Total 1 user online :: 0 Terdaftar, 0 Tersembunyi dan 1 Tamu

Tidak ada

User online terbanyak adalah 224 pada Sat Aug 21, 2010 12:24 pm

Encrypting Password

Topik sebelumnya Topik selanjutnya Go down

Encrypting Password

Post by Admin|Gana on Sat Feb 06, 2010 2:30 pm

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>

Admin|Gana
Commander
Commander

Zodiac : Taurus Jumlah posting : 635
Join date : 22.07.09
Age : 24
Lokasi : Depan LCD butut ..

http://smktipembangunan.forummotion.com

Kembali Ke Atas Go down

Topik sebelumnya Topik selanjutnya Kembali Ke Atas


 
Permissions in this forum:
Anda tidak dapat menjawab topik