我有登录页面和个人资料页面,如果登录重定向到特定标签面板 我的代码正在关注。
登录页面
<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>";
}
}
?>
个人资料页面
<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>
当我登录时,它会自动进入编辑面板(profile.php#edit)