14.08.2012, 18:22
Hello. I'm currently in progress with a roleplay gamemode, and I want to make it possible for people to
make an in-game character/account through my website, which isn't hard at all.
Though, I want it to be hashed into whirlpool when it gets putten into the database.
This is my php script that inserts the character/account name, password and email.
And this is my index.html
Thanks in advance!
make an in-game character/account through my website, which isn't hard at all.
Though, I want it to be hashed into whirlpool when it gets putten into the database.
This is my php script that inserts the character/account name, password and email.
PHP код:
<?php
$con = mysql_connect("-Private-","-Private-","-Private");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ThomasRdb", $con);
$sql="INSERT INTO accounts (id, Username, Key, Email)
VALUES
('','$_POST[charactername]','$_POST[password]','$_POST[email]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Your account has been made!";
mysql_close($con);
?>
Код HTML:
<html> <body> <form action="insert.php" method="post"> Character name (i.e John_Smith):<input type="text" name="charactername" /> Password: <input type="text" name="password" /> Email: <input type="text" name="email" /> <input type="submit" /> </form> </body> </html>