0

i have login page and profile page, if am login redirect to specific tab panel my code is following.

Login page

<form action="login.php" method="post">
<input type="email" name="email">
<input type="email" name="password">
<input type="submit" value="login" name="login">
</form>
<?php
ob_start();
session_start();
include 'db.php';
if(isset($_POST['login']))
{
    $email= $_POST['email'];
    $password = $_POST['password'];
    $sql = mysql_query("select * from user_details where email= '$email' and password = '$password'");
    $rows = mysql_fetch_array($sql);
    $count = mysql_num_rows($sql);
    if($count==1)
    {
        $_SESSION['phone'] = $phone;
        header('Location: profile.php#edit');
    }
    else
    {
        echo "<script>alert('Invalid Phone Number and Password Try Again'); location.href='index.php';</script>";   
    }
}
?>

profile page

<div class="panel-body">
  <div class="tab-content">
     <div class="tab-pane active" id="profile">Profile tab </div>
  </div>
</div>

<div class="panel-body">
  <div class="tab-content">
     <div class="tab-pane" id="edit">Edit Profile tab </div>
  </div>
</div>

When i get login it automatically go to edit panel (profile.php#edit)

  • 4
    [Why shouldn't I use mysql\_\* functions in PHP?](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php?rq=1) – cHao Dec 01 '15 at 05:44
  • actually i know header() to access tab panel id that's why is this possible ? – Mohan Sundaram Dec 01 '15 at 05:46

0 Answers0