Page 1 of 1

[56K WARN] IS there a reload page function I am missing?

Posted: Sun Jul 29, 2007 5:34 pm
by gregorious
Working on a CMS, and the screen shot below shows the EDIT PICTURE page. After the customer selects a picture to edit, the page below results.

I included the other images (associated with that residentail record) so the customer can refer to them as needed. I also decided to let the customer change their mind and edit a different image -- hence the EDIT buttons.

The EDIT button passed the residential ID and the image ID to the same edit page -as you see it below. I expected it to relaod with the newly selected picture to show up at the top of the page. But the page does not update, it just stays the same. IS there a reload page function I am missing?

Image[/img]

Posted: Sun Jul 29, 2007 6:48 pm
by John Cartwright
You can use header() to load the page again, which is usually what I do after a succesful form submission to avoid duplicate entries.

However, my spider sense is telling me you are probably fetching/displaying the results prior to updating your records.

Posted: Sun Jul 29, 2007 7:03 pm
by superdezign
Jcart wrote:You can use header() to load the page again, which is usually what I do after a succesful form submission to avoid duplicate entries.
Yes, the 'Location' header changes the current page you are on, including the posted data. So, if you plan to keep the posted data in your form somehow, header redirection is a bad idea.