0

这是我的表单声明

  <form enctype="text/plain" method="post" action="PI_Application_Submission.php">

这是我的输入:

  <tr><td>Requested User Name<font color="red">*</font></td> <td><input type="text" name="user_name" size="35"></td></tr>

这是我的php行...

  echo $_POST['user_name'];

我知道如何检查 isset 函数,这不仅仅是一个警告。由于某种原因, user_name 的值没有被传递。我究竟做错了什么?

我的错误信息如下:

  Notice: Undefined index: use in /var/www/html/PI_Application_Submission.php on line 6 
4

2 回答 2

2

Try to removing enctype form attribute. Basically PHP does not parse POST when your enctype different from application/x-www-form-urlencoded or multipart/form-data.

You can access to raw post data with file_get_contents('php://input')

于 2012-05-16T19:24:59.867 回答
0

You also need an ID attribute on the input element, also, don't forget to close your html tags

<input type="text" name="user_name" id="user_name" size="35" />
于 2012-05-16T19:24:32.737 回答