Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $email=$password="";
- $error_email=$error_password="";
- if(isset($_POST['submit']))
- {
- $email=trim($_POST['email']);
- $password=trim($_POST['password']);
- if($email=="")
- {
- $error_email="Email field is required";
- }
- if($password=="")
- {
- $error_password="Password field is required";
- }
- if($email!="")
- {
- if (!filter_var($email, FILTER_VALIDATE_EMAIL))
- {
- $error_email=" Invalid email address";
- }
- else
- {
- if($error_email=="" && $error_password=="")
- {
- $query="SELECT * from tbluser where email='$email' AND password='$password'";
- $extquery=$conn->query($query);
- $getRec=$extquery->fetch_assoc();
- if($getRec)
- {
- $_SESSION['user_detail']=$getRec;
- //print_r($_SESSION['user_detail']['name']); die;
- header('location: http://videwatch.in');
- }
- else
- {
- $error_email="Invalid email and password";
- $error_password="Invalid email and password";
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement