Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `<?php
- $username = $_POST['user'];
- $password = $_POST['pass'];
- //connect to the server
- mysql_connect("localhost","root","");
- mysql_select_db("users");
- //query
- $result = mysql_query("select*from users where username = '$username' and password ='$password'")
- or die ("failed to query".mysql_error());
- $row =mysql_fetch_array($result);
- if($row['username']==$username && $row['password']==$password)
- {
- echo "login success!!! welcome". $row['username'];
- }
- else
- {
- echo "failed to login";
- }
- ?>`
Add Comment
Please, Sign In to add comment