Advertisement
Guest User

Untitled

a guest
Sep 15th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3.         $db = mysql_connect('localhost', 'root', 'Onlyforme1') or die('Could not connect: ' . mysql_error());
  4.  
  5.         // Strings must be escaped to prevent SQL injection attack.
  6.         $username = mysql_real_escape_string($_GET['username'], $db);
  7.         $password = mysql_real_escape_string($_GET['password'], $db);
  8.         $hash = $_GET['hash'];
  9.         $secretKey="pigsfeet";
  10.         $real_hash = md5($username . $password . $secretKey);
  11.         if($real_hash == $hash) {
  12.         if (mysql_query("CREATE DATABASE $username",$db)){
  13.         echo "Database created";
  14.         mysql_select_db('username') or die('Could not select database');
  15.         mysql_close($db);
  16.         echo "Account created!";
  17.         }
  18.         else{
  19.         echo "Account Creation failed." . mysql_error();
  20.         }
  21.     }
  22.  
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement