PHP HTML No refresh submission form, phphtml submit form
Typically, we use AJAX to submit a form without a flush. A while ago, I followed the boss. Another way to submit a form without flushing is to use the IFRAME framework. Now let's sort it out and share it with everyone.
The first type:
HTML page
No Refresh Submission Form
PHP Page: form.php
<?php//non-null authentication if (empty ($_post[' uname ') | | empty ($_post[' pwd ")) { echo '; Exit } //Verify password if ($_post[' uname '! = ' Jack ' | | $_post[' PWD ']! = ' 123456 ') { echo '; Exit } else { echo '; Exit }
The second type:
HTML page
IFRAME Submission Form
PHP Page: form.php
<?php//Set time zone Date_default_timezone_set (' PRC '); /* Message status : Status msg: Prompt message */$msg = array (' status ' =>0, ' msg ' = '); Get the data submitted $name = $_post[' username '); $pwd = $_post[' userpwd '); Analog Login Verification $user = Array (); $user [' name '] = ' jack '; $user [' pwd '] = ' jack2014 '; if ($name! = $user [' name ']) { $msg [' msg '] = ' The user is not registered! '; $str = Json_encode ($msg); echo $str; Exit }else if ($pwd! = $user [' pwd ']) { $msg [' msg '] = ' input password error! '; $str = Json_encode ($msg); echo $str; Exit } $msg [' msg '] = ' login successful! '; $msg [' status '] = 1; $str = Json_encode ($msg); Echo $str;
The above is the whole content of this article, I hope that you learn PHP programming help.
Articles you may be interested in:
- PHP multiple Submit Form processing method
- The difference between if ($_post[submit]) and if (Isset ($_post[submit)) when PHP submits the form
- Code that restricts IP segment access in PHP and prevents IP from submitting forms
- PHP prevents cross-domain submission of forms
- How to keep the information that has been filled in after the PHP submission form fails
- How PHP prevents remote submission of forms outside the station
- thinkphp Default Auto-escaping when submitting a form
- PHP+HTML5 How to submit forms and upload pictures using Formdata objects
- How the PHP submission form sends messages
- PHP prevents users from repeating the form
http://www.bkjia.com/PHPjc/1117021.html www.bkjia.com true http://www.bkjia.com/PHPjc/1117021.html techarticle php HTML No refresh submission form, phphtml submission form usually for no refresh submission form, we are all implemented using AJAX. Some time ago to follow the boss to learn another type of no-refresh submission table ...