PHP simple : PHP tutorial, MySQL tutorial
PHP Tutorial - Free PHP Script

Home | Tutorials | PHP & MySQL Resources | Web Tools
Introduction & Get Start
Using Form
PHP Tags
PHP Variables
PHP Control Structures
Create Database & Table
Database Connection
Insert Record
Select Record
Update Record
Delete Record

Encrypting Password - Make your Login More Secure with md5() function.

Tutorials > Encrypting Password - Make your Login More Secure with md5() function.

Learn how to encrypt your mySQL data record with a powerful function "md5()". Great for secure your passsword record in Member Login system. This function out-put a 32 character hexadecimal number.

Syntax :

md5(string str [, bool raw_output]);

This tutorial shows in 1 file "md5.php".


This file including with a form with 1 text fields "password" and show the result when you submit.

Source Code

<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form id="form1" name="form1" method="post" action="<? echo $PHP_SELF; ?>">
<input name="password" type="text" id="password" />
<input type="submit" name="Submit" value="Submit" />
<hr />
// if POST value "password" exists.
// Make the md5() value and put it in $result.
echo "md5() result of '$_POST[password]' is : <br>";
echo $result;


* You can apply it to your Member-Login script for more security.

  • Apply md5() to the real in-put password and put it's result as "password" into database when sign-up in the first time.
  • When you make the Login script, apply md5() for the in-put password as the same above but this result for check the matching in the database.
    See Login - Logout with a Session in 1 file.

Create your Email Server
You can create an email sending program easily by PHP but, you need email server to test it. Don't upload to your online server! Now, create your own email server on your machine and test your email sending program faster.
Export MySQL to CSV (Excel)
You can export your MySQL database to .csv file format (Microsoft Excel file) easily.
[email protected]