<div class="navbar"> <a href="index.html">home</a> <a href="about.html">about us</a> <a href="brand.html">brand</a> <a href="portfilo.html">porfile</a> <a href="admin_page.php">control panel</a> <div class="navbar-right"> <a href="signup.php">Sign Up</a> <a href="login.php">Login</a> </div> </div>
<div class="navbar"> <a href="index.html">home</a> <a href="about.html">about us</a> <a href="brand.html">brand</a> <a href="portfilo.html">porfile</a> <a href="user_page.php">user page</a> <div class="navbar-right"> <a href="signup.php">Sign Up</a> <a href="login.php">Login</a> </div> </div>
<?php @include 'config.php'; session_start(); if(isset($_POST['submit'])){ $name = mysqli_real_escape_string($conn, $_POST['name']); $email = mysqli_real_escape_string($conn, $_POST['email']); $pass = md5($_POST['password']); $cpass = md5($_POST['cpassword']); $user_type = $_POST['user_type']; $select = " SELECT * FROM user_form WHERE email = '$email' && password = '$pass' "; $result = mysqli_query($conn, $select); if(mysqli_num_rows($result) > 0){ $row = mysqli_fetch_array($result); if($row['user_type'] == 'admin'){ $_SESSION['admin_name'] = $row['name']; header('location:admin_page.php'); }elseif($row['user_type'] == 'user'){ $_SESSION['user_name'] = $row['name']; header('location:user_page.php'); } }else{ $error[] = 'incorrect email or password!'; } }; ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)