forcing refresh after storing data to the database

Creating and modifying plugins.
Post Reply
eburrows
Regular
Posts: 19
Joined: Fri May 05, 2006 11:28 pm

forcing refresh after storing data to the database

Post by eburrows »

I have a generic HTML + PHP question that has been driving me crazy for the last few hours. I have a form on one on my plugins that uses an HTML form and upon hitting the submit button does some processing and updates a timestamp in one of my tables. Once the submit finishes it returns to the form but displays old information. For example, say i have a user form that says 10 entries and each of those entries has an associate timestamp associated with it. When i enter the page obviously all the information is correct. Then i select some options and hit a submit button, some processing takes place, inserts a new timestamp into the database for a processed entry from the previous form and then finishes. Now the html form still shows the same timestamp that it did originally so the data is old and stale and I am not sure how to force the page to reload. I tried some javascript stuff and sending HTML headers but haven't figured out a solution yet. I tried looking at the serendipity_admin and the edit entries stuff this after saving an entry all previous data is retained. I am guessing that this stuff is stored in the serendipity array for later retrieval? I also tried using various types of PHP vars to try to retain this persistent data but i have been beating my head against the table because I stink at HTML.

So is there anything I can do so that I don't have to manually refresh the page every time data is changes are made to my table? Obviously the answer is yes but a pathetic coder could use some help :(. Any help would be greatly appreciated.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: forcing refresh after storing data to the database

Post by garvinhicking »

Hi!

You simply need to insert your new entries before your plugin fetches the information/data! :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply