Advertisement
Guest User

Untitled

a guest
Mar 17th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. //register php
  4.  
  5. error_reporting(0);
  6.  
  7. $regUsername = $_POST['reg-username'];
  8. $regEmail = $_POST['reg-email'];
  9. $regPassword = $_POST['reg-password'];
  10.  
  11. if(isset($regUsername) && isset($regEmail) && isset($regPassword)){
  12. $connect = mysql_connect('localhost', 'root', '');
  13. $selectDB = mysql_select_db('supermazad');
  14. $query = mysql_query("INSERT INTO users (username, email, password) VALUES ('$regUsername', '$regEmail', '$regPassword')");
  15. $checkIfSame = mysql_query("SELECT * FROM users WHERE username AND email LIKE '$query' ");
  16. echo '<h1 class="successMessage">You have successfully registered!</h1>';
  17. }
  18. if($regUsername || $regEmail == $checkIfSame){
  19. echo '<h1 class="errorMessage">The username or e-mail already exists.</h1>';
  20. }
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement