Skip to content

Instantly share code, notes, and snippets.

@Alex-V
Created January 22, 2011 20:30
Show Gist options
  • Save Alex-V/791445 to your computer and use it in GitHub Desktop.
Save Alex-V/791445 to your computer and use it in GitHub Desktop.
<?php
mysql_connect('localhost:3306', 'mysql_user', 'mysql_pass');
mysql_select_db('realmd');
$username = strtoupper(mysql_real_escape_string($_GET['username']));
$email = mysql_real_escape_string($_GET['email']);
$pass = strtoupper(mysql_real_escape_string($_GET['password']));
$sha_pass = SHA1($username.':'.$pass);
$ip = $_SERVER['REMOTE_ADDR'];
mysql_query(
'INSERT INTO account (username,sha_pass_hash,email,last_ip,expansion)
VALUES ("'.$username.'", "'.$sha_pass.'", "'.$email.'", "'.$ip.'", 2)'
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment