How can I check the data from an html post to a php file and then check the data in the PHP file? if there is a data error, a prompt is displayed in the html to re-enter the data? For example, if a new user of a website is registered and the user name exists, how does one check and a prompt dialog box appears? Or if the entered login password is incorrect, how does one prompt an error after checking? Which of the php tag and script tag can be set in? I figured out a way to implement it, but php and javascript are required to be combined, but how can I check the data in the php file after processing the data from the html post to a php file, if the data is incorrect, the prompt "re-input" appears in html?
For example, if a new user of a website is registered and the user name exists, how does one check and a prompt dialog box appears? Or if the entered login password is incorrect, how does one prompt an error after checking? Which of the php tag and script tag can be set in? I tried to implement it, but php and javascript are needed, but I don't know how to nest it.
------ Solution --------------------
Let's take a look at the PHP and mysql web development system ..
------ Solution --------------------
Example
A.
User input registration name
Triggered after the input is complete, the mouse focus is left, or triggered in other ways, depending on the method you need
Trigger ajax events
B.
Ajax uses GET or POST to pass the user name to the server.
For example? Username = test
Server checkName. php
C. The server checkName. php checks whether the user name is repeated and returns the result to ajax.
D. ajax performs output processing based on the returned information (the jquery pop-up p is displayed ).
The process looks like this. let's look at jquery and handle this encapsulated code.
------ Solution --------------------
The newnew process has all been mentioned ~ You can write the specific code.
----
For example, if a new user of a website is registered and the user name exists, how does one check and a prompt dialog box appears?
This requires ajax to submit the check.
----
Or if the entered login password is incorrect, how does one prompt an error after checking?
This also requires ajax to submit the check.
----
Which of the php tag and script tag can be set in?
I tried to implement it, but php and javascript are needed, but I don't know how to nest it.
JavaScript code blocks cannot be embedded in php labels. you can print and echo the output.
JavaScript code blocks can be embedded with php code.