我正在尝试制作一个适用于 Pancake 的简单登录脚本。(在线发票)
无论您在表单中输入什么内容,它都会重定向到“else”语句。而不是尝试重定向到成功页面。
<?php
$con=mysqli_connect("example.com","example","example","example");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT * FROM mypanda_clients
WHERE unique_id='$_POST[username]'");
while ($row = mysqli_fetch_array($result))
{
if ($_POST[password] == $ROW[passphrase])
{
header('Location: http://www.green-panda.com/my_panda/Clients/'.$_POST[username]); // concatenate the string
}
else
{
echo "The username and or password was incorrect. Please try again."; // missing semi colon
}
}
?>