Php form redirect retain data

Source: Internet
Author: User
Help php form redirect retain data help & nbsp; hope to click the submit button, the form data is retained and a new window does not pop up & nbsp; how to implement it? The code is as follows: login.html & lt; form & nbsp; nameloginform & nbsp; actionlogin. php & nbsp; methodpost & nbsp; onSub asks for php form redirection to retain data
For help, I hope that after clicking the submit button, how can I keep the form data and do not bring up a new window?
The code is as follows:
Login.html



Record. php
 $ Con = mysql_connect ("localhost", "root", "w123456 ");
If (! $ Con)
{
Die ('could not connect: '. mysql_error ());
}

Mysql_select_db ("peixunrecord", $ con );
Mysql_query ("set names 'utf8 '");

$ Bumen = $ _ POST ['bumen'];
$ Keduimokuai =$ _ POST ['keduimokuai'];
$ Xingming = $ _ POST ['xingming'];
$ Peixunshijian =$ _ POST ['peixunshijian '];
$ Keti = $ _ POST ['keti'];
$ Xinde = $ _ POST ['xinde'];
$ SQL = "INSERT INTO record (bumen, keduimokuai, xingming, peixunshijian, keti, xinde) VALUES ('$ bumen', '$ keduimokuai', '$ xingming ', '$ peixunshijian', '$ keti',' $ xinde ')";
If (! Mysql_query ($ SQL, $ con ))
{
Die ('Error: '. mysql_error ());
}

How can we achieve this? Thank you!

// Echo "script" alert ('submission successful! '); Location. href =' ". $ _ SERVER [" HTTP_REFERER "]." '; script ";
// Echo "automatically jump 3 seconds after submission successful ";
// Echo "if automatic jump is not performed, click here to return ";
// Headers ("Refresh: 5; url = http://www.baidu.com ");
Mysql_close ($ con );
?>

------ Solution ----------------------
Iframe or ajax submit a form...

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.