Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('include/db_con.php');
- session_start();
- if (isset($_POST['username'],$_POST['password']))
- {
- $username=$_POST['username'];
- $password=$_POST['password'];
- if (empty($username) || empty($password))
- {
- $error = 'Hey All fields are required!!';
- }
- else {
- $login="select * from users where user_name='".$username."' and user_password ='".$password."'";
- $result=mysql_query($login);
- print_r($result);
- if(mysql_fetch_array($result)){
- $_SESSION['logged_in']='true';
- $_SESSION['username']=$username;
- header('Location:registration.php');
- exit();
- } else {
- $error='Incorrect details !!';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement