我的詳細情況如下
login page
<form onsubmit='return formValidator()' action='https://mcqpage.com/connection/' method='post'>
<h2>Enter Your Details</h2><hr/>
<label>Name :</label>
<input type='text' name ='addr1' id='addr' /><br />
<label>Password :</label>
<input type="password" name="password" id="password">
<input type='submit' value='Check Form' />
connection page
> [insert_php]
session_start();
if($_POST['addr1']!="" && $_POST['password']!=""){
session_start();
[email protected]_connect("") or
mysql_error();
if (!$connec) {
die('Could not connect: ' . mysql_error());
}
$email=$_POST['addr1'];
//echo"$email";
$password= $_POST['password']);
if ($email=="")
{
echo "Enter User Name.......";
}
else
$result = mysql_query("SELECT * FROM `database`.`table` WHERE
password='$password' and name='$email'");
$data = mysql_num_rows($result);
if($data==1)
{
$_SESSION['email']=$email;
$_SESSION['password']=$password;
wp_redirect('https://mcqpage.com/page', 301);
exit;
}
else
{
header("location:http://www.mcqpage.com/index.php");
}
}
//connection closed
mysql_close ($connec);}
else{
header("location:http://www.mcqpage.com/index.php");
}
[/insert_php]
哪一個是工作頭()或wp_redirect() – hassanzeb
你正在使用哪個鉤子? – vel
您是否收到任何錯誤?告訴我們,如果是這樣的話......它是在'if'條件還是'else'條件下進行......請更加清楚。 –