Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db = mysql_connect('localhost', 'root', 'Onlyforme1') or die('Could not connect: ' . mysql_error());
- // Strings must be escaped to prevent SQL injection attack.
- $username = mysql_real_escape_string($_GET['username'], $db);
- $password = mysql_real_escape_string($_GET['password'], $db);
- $hash = $_GET['hash'];
- $secretKey="pigsfeet";
- $real_hash = md5($username . $password . $secretKey);
- if($real_hash == $hash) {
- if (mysql_query("CREATE DATABASE $username",$db)){
- echo "Database created";
- mysql_select_db('username') or die('Could not select database');
- mysql_close($db);
- echo "Account created!";
- }
- else{
- echo "Account Creation failed." . mysql_error();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement