PHP HTML No refresh submission form, phphtml submit Form _php Tutorial

Source: Internet
Author: User
Tags learn php learn php programming

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 true 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 ...

  • Related Article

    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: 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.