ok pretty much Iv written a script like so
Define General Content (fixed)
Define variable Content
Refresh Page using header function (note this is also variable)
The problem I am faceing is that my script displays the variable content, but hence there is often a possible refresh, when there is a refresh, the variable content is lost. Note I want this variable content to be displayed Once and only once, just after the refresh.
The reason for the refresh is that the general content will often include a table from mysql, that needs to be refreshed as, later on in the script a new row is added.
I have tried a few different things, though my script often ends up in a loop, so the variable data ends up in a list form. I have spent some time, I am relativly new to scripting, so any help would be much apreciated
Thanks, Any questions as to what I mean, feel free
Post info after a refresh
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
We can't refresh, sorry to say. We can only redirect which means that the particular page's information is lost, considering you are technically at a new page.
What you'll need to do is have the table updated before you begin to output. All back-end operations should be done prior to rendering. At no point should a redirect to the same page be necessary.
What you'll need to do is have the table updated before you begin to output. All back-end operations should be done prior to rendering. At no point should a redirect to the same page be necessary.
I would modify that a little. It's quite common to redirect to the same page with different parameters in either $_POST or $_GET variables. If you need to save data from one page to the next, you have two choices: either use $_SESSION variables or pass them as $_POST variables within a form (they can be hidden, if that's desirable) or as $_GET variables (to be avoided, if they contain hints about the content that you don't want to be obvious).superdezign wrote:We can't refresh, sorry to say. We can only redirect which means that the particular page's information is lost, considering you are technically at a new page.
What you'll need to do is have the table updated before you begin to output. All back-end operations should be done prior to rendering. At no point should a redirect to the same page be necessary.
The other possibility is to use Ajax, which does enable you to refresh some data on a page without redirecting the whole page.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm