Advertisement
Guest User

Untitled

a guest
May 31st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. $usern = $_POST['username'];
  3. $passw = $_POST['password'];
  4. include 'config.php';
  5.  
  6. if(isset($_POST["username"]) && isset($_POST["password"])) {
  7.     mysql_connect($host,$username,$password);
  8.     @mysql_select_db($database) or die( "Unable To Connect To Database $database");;
  9.     $cusername = mysql_real_escape_string($usern);
  10.     $cpassword = mysql_real_escape_string($passw);
  11.     $hashedpw = $cpassword;
  12.     mysql_query("INSERT INTO characters(username, password) VALUES('$cusername', '$hashedpw') ") or die(mysql_error());
  13.     mysql_close();
  14.     echo "<script>alert('Account Has Been Created Sucessfully!')</script>";
  15.     }
  16.     else
  17.     {
  18.         echo $html."<center><br>Error!<br></center>".$footer;
  19.     }
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement