murdocsvan
Web Programmer
- Messages
- 896
- Location
- Surrey, UK
I'm making a basic form which i can use to input passwords into a MySQL database. Before it's entered into the database however, i need it turned into an MD5 key, so that the MD5 is put onto the database, not the actual password.
I'm sure it's a simple of comma is the wrong place or something, but can someone help me out please?
EDIT: It returns a parse error on line 15.
I'm sure it's a simple of comma is the wrong place or something, but can someone help me out please?
Code:
<?php
$con = mysql_connect("localhost","user","password1234");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
$password = md5($_POST["password"]);
mysql_select_db("database", $con);
$sql = "INSERT INTO members (id,username, password)
VALUES ('$_POST["username"]',$password)";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>
EDIT: It returns a parse error on line 15.