![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2004
Posts: 3
Rep Power: 0
![]() |
I use PHP script to access MySQL database. The script is generates a typical form with some edit entries and submit button. These edit controls are filled from MySQL table and used to add/change entries. To see, what fields was actualy changed by user I use cookies, contains initial fields state and compare them with posted values.
There I got a problem: users don't want to reopen or simple refresh page, and information on it is becames no more valid! To prevent user to modify entries, was changed by another user since last page refresh, I reread MySQL table and warn user, if the difference between cookie and MySQL table entry is appeared. But... I can warn user only in the "form results page", and when user is clicked Refresh button on this page, the information is resended by browser and rewrite table fields, I want to protect!So, I decided to show only simple results page and then quickly reload to the main view. What can I do to automaticaly open another page, when first is apeared, without any "Click here to display main page" links? May be I use wrong design method? (I'm novice in PHP. Only two weeks I programming on them ) |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0
![]() |
You could use ....
<META HTTP-EQUIV="refresh" CONTENT="5";> to simply refresh the page at an interval of however many seconds (in this case 5). I'm sure there is a way to do it in Javascript that would make it reload only once but all I can find in my JavaScript books at the mo islocation.reload(true) Maybe you could set up something in PHP that worked with the first command but only performed it once, like a count variable that would mean that line of code is only included once? Not really too sure what you want from this but anyway there you go with my attempt now let the intelligent people come tell you how to do it ![]()
__________________
Don't wound what you can't kill |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2004
Posts: 3
Rep Power: 0
![]() |
Yes, thank you
![]() I found the way thanks to your assistance. I use <META HTTP-EQUIV="refresh" CONTENT="5, URL=http://"> to go to my initial page after 5 seconds since page download. Thanks. |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0
![]() |
wow i helped! :blink:
__________________
Don't wound what you can't kill |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|