Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //connect to DATABASE
- $db = @mysql_connect('localhost','root','');
- mysql_select_db('tutorial',$db);
- ?>
- <?php
- if(isset($_POST['register'])){
- echo "BUTTON PRESSED <br />";
- if(!empty($_POST['username']) && !empty($_POST['password'])){
- $un = $_POST['username'];
- $pw = $_POST['password'];
- $get = mysql_query("SELECT username,password FROM users WHERE username='$un' AND password='$pw'");
- if($get){
- header('Location: index.php');
- }else{
- echo "Oops!";
- }
- }
- }
- ?>
- <!--
- Login HTmL FORM
- -->
- <form action="" method="POST">
- <input type="text" name="username" placeholder="Username" />
- <input type="password" name="password" placeholder="Password" />
- <input type="submit" name="register" value="register" />
- </form>
Add Comment
Please, Sign In to add comment