How to clear the data in $ _ POST?

Source: Internet
Author: User
How do I clear the data in $ _ POST? I tried to write a login interface, which was not completed yet. I found the problem during the test. The values in $ _ POST are not cleared. each time you enter a user name, there is one more user name in $ _ POST. The consequence is that the user name cannot be entered correctly after the first error is entered... Unless the browser refreshes the page... & Lt ;! How does DOCTYPE & nbsp clear the data in $ _ POST?
I tried to write a login interface, which was not completed yet. I found the problem during the test. The values in $ _ POST are not cleared. each time you enter a user name, there is one more user name in $ _ POST. The consequence is that the user name cannot be entered correctly after the first error is entered... Unless the browser refreshes the page...









Welcome back

.auto-style2 {
text-align: center;
}
.auto-style1 {
font-size: 36pt;
text-align: left;
}
.auto-style4 {
font-family: Broadway;
font-size: xx-large;
}











Welcome back






Log in:








require_once 'connectDB.php';

print ' .error {color: red;}';

if($_SERVER['REQUEST_METHOD']=='POST')
{
$problem = false;
$login = false;

if(empty($_POST['user_name']))
{
$problem = true;
print ' Please enter your user name!

';
}
if(empty($_POST['password']))
{
$problem = true;
print ' Please enter a password

';
}

if(!$problem)
{
$user = trim(stripslashes($_POST['user_name']));
$pwd = trim(stripslashes($_POST['password']));
$user = mysql_real_escape_string($user);
$pwd = mysql_real_escape_string($pwd);

$q = "SELECT * FROM USER WHERE USER_NAME = '$user' and PASSWORD = '$pwd'";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.