Web page Data Preservation Method--PHP development

Source: Internet
Author: User
Tags php web development
PHP Web Development Database

Little brother is doing a website, using PHP development;

Divided into 3 pages, each page will let users fill in some of the content;

Need to set up a database to save the user's settings on page 3rd, then how to get 1, 2 pages of data on page 3rd;

You need to consider when the 33rd step has not yet established the database,
The user returns to the previous 1.2 page to modify again, this situation needs to show the user just fill in some of the data, can not let the user return after nothing, and have to re-fill;

What happens if the user is in a lot of situations? (assuming that 10,000 users are working together)


At present I think of the 1, 2 page user set up after the database, on the 3rd page is read out, but this feeling is rather strange.

The first time to do the website, ask the big God pointing.


Reply to discussion (solution)

This little brother, I think the first 3 steps can be written in a cookie, or can be written into the session. Finally, save it to the database.

Can you give me a simple example? Thank you

It can also be made into fake three pages. Three Div is actually switching back and forth. Click Next page to hide the first Div, the second display, and so on. So the information you entered before is definitely in the

1, 3 floor of the method are very good

"Back to front" refers to whether the back button was pressed or the URL was re-entered?

"Back to front" means press the back button.

This should be said: If the user set the content of 1.2 pages. to 3 page and feel that the 1 page has changed, and then return to the 1 page changes,
The effect I want is that users can see the last settings when they return to page 1!

This feature browser helps you to do it, the browser saves the history record.

I didn't make it clear that each page would give the user an initialized default value. For example, using PHP to remove the current time, and the page data per user must be different,

In this case the browser will definitely not save it?

There is a fallback best with cookies, there is no initialization or so-called, first read initialization, and then read the cookie, the latter has a value to cover the former

Cookie is the perfect choice

Or you can also use local stroage
Specifically, you can see
JavaScript Local storage practices (HTML5 localstorage and IE's UserData)

First you have to be clear: a user and 10,000 users are using the same process in the same way.
So you just have to think about what a user is doing.

3 pages, from the first entry to the second, from the second into the third one. Actually, it's all submitted.
If you allow users to fall back to the previous page, you should set the fallback button on the page instead of relying only on the browser's Back button

The browser's Back button will reply to the field of the previous page form, but not necessarily always the action you need
When the form page uses a session, the browser is prevented from resuming the scene by default

It can also be made into fake three pages. Three Div is actually switching back and forth. Click Next page to hide the first Div, the second display, and so on. So the information you entered before is definitely in the

Why do not need 1 pages,, a page divided into 3 parts, the contents of the random change

Session server pressure is high when tens of thousands of users are using the same time

The general approach is to
The first page fills in input and then posts to the second page


The second page fills in input plus the first page submits the value as




The third page fills in input plus the first 2 pages submit values such as




And what to do with it.

Support 3 Floor, in addition, if need to initialize, can be used in conjunction with Ajax, the effect of the leverage ~ ~ ~


It can also be made into fake three pages. Three Div is actually switching back and forth. Click Next page to hide the first Div, the second display, and so on. So the information you entered before is definitely in the

Why do not need 1 pages,, a page divided into 3 parts, the contents of the random change


It can also be made into fake three pages. Three Div is actually switching back and forth. Click Next page to hide the first Div, the second display, and so on. So the information you entered before is definitely in the

Why do not need 1 pages,, a page divided into 3 parts, the contents of the random change

And if it goes back, does it have to be sent back?

Session server pressure is high when tens of thousands of users are using the same time

The general approach is to
The first page fills in input and then posts to the second page


The second page fills in input plus the first page submits the value as




The third page fills in input plus the first 2 pages submit values such as




And what to do with it.

If the fallback is to pass it back?


session when tens of thousands of users simultaneously use the server pressure

General processing method is
The first page to fill in input and then post to the second page


Second page fill in input plus the first page submitted values such as




Third page fill in input plus the first 2 pages submitted values such as




and then what do you want to How to deal with it.

If fallback should be passed back?

It's still a good way to do this, regardless of the cookie, you can do a fallback form to submit back to the page you want to modify, and finally which page will add the database function you want to do



It can also be made into fake three pages. Three Div is actually switching back and forth. Click Next page to hide the first Div, the second display, and so on. So the information you entered before is definitely in the

Why do not need 1 pages,, a page divided into 3 parts, the contents of the random change


It can also be made into fake three pages. Three Div is actually switching back and forth. Click Next page to hide the first Div, the second display, and so on. So the information you entered before is definitely in the

Why do not need 1 pages,, a page divided into 3 parts, the contents of the random change

And if it goes back, does it have to be sent back?

The fallback action is to hide the 3rd part, show the second part, in the fallback to hide the second section shows the first part, as long as you use the field ID is not the same, then the values will be saved on the page,

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