Passing information between pages

Asked

Viewed 178 times

0

How best to pass information (data) between pages?

Example:

I have 4(four) pages dadospessoais.php, endereco.php, habilitacoes.php and salvar.php.

On the pages (dadospessoais.php, endereço.php and habilitacoes.php) will receive the user’s data through forms, on these pages I can advance to the next and I can go back, remembering that when I go back I can recover the data entered by the user.

The page salvar.php receive all data from the 3 (three) pages and save the information in a database.

I would like to know about the performance of the application and mainly of the SERVER, what is the best way to work with the passage of this information, remembering that the page will be accessed on average by 100 to 200 users/day can have a higher access number. Currently I work with SESSION storing all the user data in a SESSION and recovering them in the same way, but I do not know if this is the most advisable way, because I have noticed a slowness in the application and some failures when I try to save the data in the database.

I have seen comments that keeping many sessions open on the server could be a loss of performance, including overloading the server, I’m not sure how it works, but all sessions that open the content is saved, depending on the server, in the tmp folder. I keep imagining many hits to the site and every data of each logged in user (name, email, phone, address, enabled etc.) being saved to the server, that’s why I wondered if there was another way, or if they use other forms in applications.

  • 3

    Session is not good for this for another reason: you can not do two operations at the same time in separate tabs without conflict (for example, I start the registration of Francisco in the first tab, and Francisca in the second tab, one will overlap the other). A way would be to use fields Hidden passed between pages, or store in a temporary DB and pass at least the card ID when going back and forth (in this case, having a array can use Session likewise, passing an ID between pages so that one tab is independent of the other).

  • all the data? Oh, just save a reference of it, only the most important, the rest you take from the bank when you need it

  • Bacco, I understood regarding the use of tabs and Hidden also, now with regard to the temporary DB, I do not know if I understood right, but I would have to save the registration data in a temporary database step? And when I went back to the page I would recover the data in this temporary database, and at the end of all the registration I would save all the data in DB would that be? Regarding the performance on the server between the two options you provided would be better then to use Hidden, in view of the performance on the server, with the requests to the database?

  • Rodrigoborth did not understand very well what he wanted to say to me, when it comes to registration form divided into 3(three) pages, being that the user can go forward and go back to the pages and also recover the entered data, you say for example, the user fills the first page and saves part of the information in a bank?

  • @Almost all conventional Dbms have temporary and even memory tables (the Session also equals a DB). If your application will revolve around thousands of users registering things at the same time, I think you can worry about performance, otherwise, it’s bullshit. Hidden field increases traffic between pages, DB uses more server space. But the quantities are so tiny, in both cases, that I think the work you can save a handful of bytes is more expensive than the benefit.

  • Depending on what you do, you can use bootstrap tabs, to group the fields by 'subject' and a save to update what has been changed. So it keeps the data on the same page without traffic.

  • 1

    Thank you very much Bacco! Papa Charlie I believe that the tabs would fit well in my case, since I want to divide by "subjects", "content" only for the user, to give the same usability and ease in filling the data, avoiding that it remains on the same page filling many fields, with the tab I can simulate the progress of the user registration and I don’t need to use Session to record the data and not even Hidden or db since I will be on the same page. Personal thank you!

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.