Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (!isset($_SESSION['username'])){
- header('location:../userregistration/login.php');
- $error="Require to Login to use this function";
- }
- }else {
- header('location:map.php');
- }
- ?>
- <?php
- session_start();
- $con = mysqli_connect('localhost','root','');
- mysqli_select_db($con, 'userregistration');
- $name = $_POST['user'];
- $pass = $_POST ['password'];
- // /*$email = $_POST['mail'];
- // $phone = $_POST['phone'];
- // $address = $_POST['address'];*/
- $s = " SELECT * FROM usertable WHERE name = '$name'&& password = '$pass'";
- $result = mysqli_query($con, $s);
- $num = mysqli_num_rows($result);
- if ($num == 1){
- $_SESSION['username'] = $name;
- header('location:../Index.php');
- }else {
- header('location:login.php');
- }
- ?>
Add Comment
Please, Sign In to add comment