Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //register php
- error_reporting(0);
- $regUsername = $_POST['reg-username'];
- $regEmail = $_POST['reg-email'];
- $regPassword = $_POST['reg-password'];
- if(isset($regUsername) && isset($regEmail) && isset($regPassword)){
- $connect = mysql_connect('localhost', 'root', '');
- $selectDB = mysql_select_db('supermazad');
- $query = mysql_query("INSERT INTO users (username, email, password) VALUES ('$regUsername', '$regEmail', '$regPassword')");
- $checkIfSame = mysql_query("SELECT * FROM users WHERE username AND email LIKE '$query' ");
- echo '<h1 class="successMessage">You have successfully registered!</h1>';
- }
- if($regUsername || $regEmail == $checkIfSame){
- echo '<h1 class="errorMessage">The username or e-mail already exists.</h1>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement