Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <div class="container">
- <form id="signup" method="post" action="">
- <div class="header">
- <img src="admin/adminpanel.png">
- </div>
- <div class="sep"></div>
- <div class="inputs">
- <input type="text" placeholder="Username" name="admin-username" />
- <input type="password" placeholder="Password" name="admin-password" />
- <input type="Submit" Value="Sign Up"/>
- </div>
- </form>
- </div>
- <?php
- @mysql_connect('localhost', 'root', '');
- $select_db = mysql_select_db('register');
- session_start();
- if (isset($_POST['admin-username'])){
- $username = $_POST['admin-username'];
- $password = $_POST['admin-password'];
- $query = "SELECT * FROM `admin` WHERE admin-username='$username' and admin-password='$password' ";
- $result = mysql_query($query) or die(mysql_error());
- $rows = mysql_num_rows($result);
- if($rows==1){
- $_SESSION['admin-username'] = $username;
- header("Location: admin.php");
- }else{
- echo "<div class='form'><h3>Username/password is incorrect.</h3></div>";
- }
- }else
- ?>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement