After submitting a php form, how does the pop-up dialog box pop up on the current page?

Source: Internet
Author: User
Tags php form
After the php submission form is passed, how does the pop-up dialog box pop up after the php submission form is passed on the current page? How does the pop-up dialog box pop up on the current page instead of on a blank page? To achieve this effect: instead of a blank page pop-up: if you use PHP on the backend for verification, use Ajax; for reference only: HTMLcode & lt; formname = & quot; after myform & quot; act php submits a form, how does the pop-up dialog box pop up on the current page?
After the php submission form is passed, how does the pop-up dialog box pop up on the current page?
Instead of popping up on a blank page?
To achieve this effect:




Instead of blank pages:


------ Solution --------------------
If PHP is used for verification at the backend, Ajax is used;
For reference only:
HTML code

------ Solution --------------------
Submit to the current page.
------ Solution --------------------
This requires ajax
------ Solution --------------------
Function login (name, pass)
{
$. Ajax (
{
'Type': 'post ',
'URL': 'http: // xxx. xx ',
'Data': 'Name = '+ name +' & pass = '+ pass,
'Success': function (msg)
{
If (msg = 'error ')
Alert ('Sorry! This account does not exist ');
Else
{
...
}
}
}

)

}
Name:

Pass:

------ Solution --------------------
After ajax submits data, the returned content is displayed in the pop-up div.
------ Solution --------------------
Ajax submission
------ Solution --------------------
You directly echo "script" alert ('XXX'); script "on the php page. This alert is displayed directly on the php page, the php page does not contain html, so it will be blank. Return the result to the html page through ajax, and then play the layer.
------ Solution --------------------
The answer is the same.
------ Solution --------------------
You can use ajax to implement
------ Solution --------------------
With ajax, you can implement it.

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.