I don't know how much you
know so I apologize if I am telling youi anything you already know. You need to understand the fundamentals of how the HTTP protocol and HTML work. Initially in the world wide web browsers would send a request for a page to the server and the server would read the HTML file and send it to the client (the browser). If that is new to you then there are thousands of places you can learn more. The important thing is that the server forgets about the request. There is nothing left in the server. The server is done with the request. Also in the early days of the internet HTML had forms but they were very basic compared to how they are currently used. Initially a form would have a submit button that would send the form contents to the server. Normally the server would execute a Common Gateway Interface (CGI) program. The CGI program would write out a HTML file that was sent to the client. Alternatively the server would show a second HTML file but that is not relevant here. The important thing is that PHP uses the same CGI technology. PHP reads a HTML file (except with PHP in it) and writes out a HTML file that is sent to the client. And here it gets complicated. Over the years various techniques have been developed so that server-side programming could retain and/or send data across requests. One way is for data in a page to be sent as part of a request that has the relevant data. Well there is much more to the story. If any of that is new to you then you have some reading to do. There are two general possible solutions to your requirements, but there are many more possibilities too. One possibility would be to send all the data to the client and do all the work in the client using _javascript_ or some client-side programming. That could provide the best performance but requires you to use _javascript_ and would compromise security. Another possibility is something called a post-back and that is quite technical. It is however using technology much like an old-style HTML form except generalized and made more technical.
|