Php $\给出未识别索引错误的POST

Php $\给出未识别索引错误的POST,php,mysql,ajax,post,Php,Mysql,Ajax,Post,我正在制作一个ajax登录脚本,我的html代码如下: <form class="form-container" action="login.php" method="POST"> <div class="form-title"><h2>Sign up</h2></div> <div class="form-title">Name</div> <input class="form-field"

我正在制作一个ajax登录脚本,我的html代码如下:

<form class="form-container" action="login.php" method="POST">
  <div class="form-title"><h2>Sign up</h2></div>
  <div class="form-title">Name</div>
  <input class="form-field" type="text" name="username" /><br />
  <div class="form-title">Password</div>
  <input class="form-field" type="password" name="pass" /><br />
  <div class="submit-container">
    <input class="submit-button" type="submit" value="Submit" />
  </div>
</form>
当我运行代码时,我在wamp服务器中得到一个错误,在我的php代码中显示未识别的索引。什么地方出了问题,我该如何解决

编辑:

我试过了,但没有成功:

if(isset($_POST["username"]))
{
     $client_username = $_POST["username"];
}

if(isset($_POST["pass"]))
{
  $client_password = $_POST["pass"];
}


echo $client_username;

echo $client_password;
试试这个,只需使用isset()检查POST变量

$client_username = "";
$client_password = "";

if(isset($_POST["username"]));
{
     $client_username = $_POST["username"];
}

if(isset($_POST["pass"]))
{
   $client_password = $_POST["pass"];
}

您是否看到了正确的login.php文件?是的,我看到了正确的文件是的,但是Passpress的值请在您的问题中输入准确的错误消息。我说了准确的错误消息,我想我应该在完整的错误消息中指出准确完整的错误消息,它标识了它找不到的字段名!!即使这样,它也会给出同样的错误。除非您在发现字段不存在时采取适当的措施,否则仅测试字段是否存在是没有用的。将它们保留为空字符串可能没有多大好处,除非数据库更新代码还检查它们是否为空——不要做任何事情
$client_username = "";
$client_password = "";

if(isset($_POST["username"]));
{
     $client_username = $_POST["username"];
}

if(isset($_POST["pass"]))
{
   $client_password = $_POST["pass"];
}