Advertisement
Guest User

myCode

a guest
Jan 12th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. include('include/db_con.php');
  3. session_start();
  4. if (isset($_POST['username'],$_POST['password']))
  5. {
  6. $username=$_POST['username'];
  7. $password=$_POST['password'];
  8.  
  9. if (empty($username) || empty($password))
  10. {
  11. $error = 'Hey All fields are required!!';
  12. }
  13.  
  14. else {
  15. $login="select * from users where user_name='".$username."' and user_password ='".$password."'";
  16. $result=mysql_query($login);
  17. print_r($result);
  18.  
  19.  
  20. if(mysql_fetch_array($result)){
  21. $_SESSION['logged_in']='true';
  22. $_SESSION['username']=$username;
  23. header('Location:registration.php');
  24. exit();
  25. } else {
  26. $error='Incorrect details !!';
  27. }
  28. }
  29. }
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement