IF structure design problems-php Tutorial

Source: Internet
Author: User
IF structure design is messy! If you have the following requirements, you are advised to guide INPUT form 1 & lt; inputtypetextnameid1value & gt; for INPUT text 1 & lt; inputtypetextnameid2value & gt; for INPUT text 2 & lt; inputtypesumbitnameidavalue; IF structure design is messy!
You have the following requirements.
INPUT Form 1
// Input text 1
// Input text 2
// Used to submit input information
I want to click submit ida and then output the INPUT form 2.
// Input text 1
// Input text 2
// Used for further submission of input information
// Return the interface of the previous input Form 1, but store the single input information of the table.
After clicking submit idb, enter Form 3.
I want to click submit ida and then output the INPUT form 2.
// Input text 1
// Input text 2
// Used to submit input information again
// Return the interface of the previous input Form 2, but store the input information of Form 2.

Enter the play Information. when you click the return button on the interface, you can save the information at the upper level for easy modification. For guidance ........ The header designed with the IF structure is a little big...

------ Solution --------------------
Directly pass the parameter through url
Or save it in the session.


Add a step to the url to identify the first step.
------ Solution --------------------
This is a typical ajax application.
A. write all the parts to be entered in

Internal
B. by default, the first p is displayed. when ajax is submitted, the second p is displayed.
C. analogy B

Content to be mastered

1. js/Jquery controls p hiding and display
2. jquery's ajax method POST/GET

------ Solution --------------------
It's okay with php.

HTML code
Script function goBack (id, o) {document. getElementById (id ). style. display = 'block'; o. parentNode. style. display = 'none';} function goNext (id, o) {document. getElementById (id ). style. display = 'block'; o. parentNode. style. display = 'none';} script
------ Solution --------------------
The session records are saved in the session and added to the session records for status transfer and data based on the request and current status.
------ Solution --------------------
After reading it for a long time, I finally figured out what you mean.
Take a look at this test example, it should be what you want
PHP code

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.