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.