Guest User

Untitled

a guest
Jun 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. include ('mysql_connect.php')
  3.  
  4. if(isset($_POST['username']) && isset($_POST['password'] && $_POST['username'] != '' && $_POST['password'] != '') {
  5.     $username = mysql_escape_string($_POST['username']);
  6.     $password = mysql_escape_string(shal($_POST['password']));
  7.  
  8.         $sql = mysql_query ("INSERT INTO `accounts` (`Username`,`Password`) VALUES ('"$username."','"$password."')");
  9.                
  10.     echo 'REGISTRATION SUCCESSFUL';
  11.                                    
  12. } else {
  13.  
  14. echo '<form action="index.php" method="post">
  15. Username: <input type="text" name="username" /><br />
  16. Password: <input type="password" name="password" /><br />
  17. <input type="Submit" name="submit" value="Register" />
  18. </form>';
  19. }
  20. ?>
Add Comment
Please, Sign In to add comment