Create simple username password datebase
<?php
// COMMIT ADD
$link = mysql_connect("localhost", "root", "")
or die("Could not connect: " . mysql_error());
mysql_select_db('registration', $link)
or die ( mysql_error());
switch ($_GET['action']) {
case "add":
switch ($_GET['type']) {
case "Register":
$sql = "INSERT INTO user_info
(username,
password,
email)
VALUES
('" . $_POST['username'] . "',
'" . $_POST['password'] . "',
'" . $_POST['email'] . "')";
break;
}
break;
}
if (isset($sql) && !empty($sql)) {
echo "";
$result = mysql_query($sql)
or die("Invalid query: " . mysql_error());
?>
<p align="center" style="color:#FF0000">
Done. <a href="admin_loggedin.php">admin</a>
</p>
<?php
}
?>
This is my code and it works but I want the password to be hashed I am not sure how I can do this Please help
|