Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="login-page">
- <div class="form">
- <form action="process.php" method="POST" class="login-form">
- <h1 class="loginTxt">Logga in</h1>
- <input type="text" placeholder="Användarnamn" id="Username" name="Username"/>
- <input type="password" placeholder="Lösenord" id="Password" name="Password"/>
- <button id="btn">Logga in</button>
- </form>
- </div>
- </div>
- <?php
- $username = $_POST['username'];
- $password = $_POST['password'];
- $username = stripcslashes($username);
- $password = stripcslashes($password);
- $username = mysql_real_escape_string($username);
- $password = mysql_real_escape_string($password);
- mysql_connect("den1.mssql4.gear.host", "lexidatabase", "PASS");
- mysql_select_db("tbl_register");
- $result = mysql_query("select (username),(password) from lexidatabase.dbo.tbl_register WHERE username = '$username' AND password = '$password'")
- OR die("Failed to querry database ".mysql_error());
- $row = mysql_fetch_array($result);
- if($row['username'] == $username && $row['password'] == $password){
- echo "login success!! Welcome " $row['username'];
- }
- else{
- echo "Failed t o login!";
- }
Add Comment
Please, Sign In to add comment