One thing I could never figure out was how to create encrypted password security systems using dreamweaver and I just figured it out using md5 and it is a piece of cake
There are at least three (3) pages will be attached with MD5 password encryption. They are Log In User, Insert Record and Update Record.
You have to insert a MD5 Password Encryption into at least three pages. They are Log In User page, Insert Record Page and Update Record page. If you do not insert MD5 in all of that pages, one of the page will not work.
The insert record code generated by Dreamweaver normally doesn't provide any encryption. In this recipe you will learn how to use MD5 in the admin page where you can insert admin record.
This is the basic insert record code generated by Dreamweaver:
$insertSQL = sprintf("INSERT INTO users (username, password) VALUES (%s, %s)",
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['password'], "text"));
mysql_select_db($database_Websiteku, $Websiteku);
Amend that code by inserting the MD5 and the bracket inside the "password":
$insertSQL = sprintf("INSERT INTO users (username, password) VALUES (%s, %s)",
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString(md5($_POST['password']), "text"));
mysql_select_db($database_Websiteku, $Websiteku);
Dreamweaver also generate Log In User code without password encryption. You can see the basic code will be like this:
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "daftar_komentar.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_Websiteku, $Websiteku);
Amend that code by inserting the MD5 and the bracket inside the "password":
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=md5($_POST['password']);
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "daftar_komentar.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_Websiteku, $Websiteku);
In the update record page you also have to change this code:
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE users SET username=%s, password=%s WHERE user_id=%s",
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['user_id'], "int"));
Amend that code by inserting the MD5 and the bracket inside the "password":
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE users SET username=%s, password=%s WHERE user_id=%s",
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString(md5($_POST['password']), "text"),
GetSQLValueString($_POST['user_id'], "int"));
+