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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
gregorious
Forum Commoner
Posts: 34
Joined: Wed Aug 23, 2006 9:55 am
Location: Orlando, FL

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

Post 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]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
Post Reply