-3

我不知道你们是否熟悉 Pancake 应用程序(自托管发票) 我正在尝试制作一个脚本,允许我的客户从我网页上的登录屏幕登录到他们的帐户。(我想我只需要一个全新的脚本,修复后修复只会提供越来越多的错误。:(

我有这个我拼凑的脚本,但它返回错误:

    <?php
$con=mysqli_connect("example.com","exampleuser","examplepass","db_name");
// 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[password])
  {
  header('Location: http://www.green-panda.com/my_panda/Clients/$_POST[username]);
  }
  else 
  {
    echo "The username and or password was incorrect. Please try again."
  }
  }
?>

返回的错误是:

Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/content/38/10473938/html/website/panda/login.php on line 21

我需要这个脚本

  1. 将用户名与数据库中的 unique_id 匹配
  2. 验证密码与 unique_id 匹配
  3. 将用户转发至:http ://www.green-panda.com/my_panda/Clients/ “unique_id”

任何帮助将不胜感激!

4

2 回答 2

2

两个错别字:

header('Location: http://www.green-panda.com/my_panda/Clients/'.$_POST[username]); // concatenate the string

echo "The username and or password was incorrect. Please try again."; // missing semi colon
于 2013-05-17T21:42:04.740 回答
0

我想你在这里失踪'了......

header('Location: http://www.green-panda.com/my_panda/Clients/$_POST[username]);
于 2013-05-17T21:35:41.260 回答