Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 22nd, 2004, 4:35 AM   #1
Dragonfly
Newbie
 
Join Date: Oct 2004
Posts: 3
Rep Power: 0 Dragonfly is on a distinguished road
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 )
Dragonfly is offline   Reply With Quote
Old Oct 22nd, 2004, 6:29 AM   #2
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
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
Ade is offline   Reply With Quote
Old Oct 22nd, 2004, 7:09 AM   #3
Dragonfly
Newbie
 
Join Date: Oct 2004
Posts: 3
Rep Power: 0 Dragonfly is on a distinguished road
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.
Dragonfly is offline   Reply With Quote
Old Oct 22nd, 2004, 8:35 AM   #4
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
wow i helped! :blink:
__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC