Guest_imported
New member
- Jan 1, 1970
- 0
1)Okay I'm working on a guestbook script which lets the users to leave their comment.
I have used two functions in the script:
guestbook.php?function=addcomment
guestbook.php?function=submit
Basically addcomment() function is to show the html form whereas submit() performs the routines
such as form field validation and stores the commments into database.
My question is: supposed when the user finished filling the comments form and clicked on the submit button,
the url will then became guestbook.php?function=submit right? At this point if he/she refreshed the page,
the same data will be submited over and over again since the script continued looping the submit() function.As the result,
the database will be trashed. Is there anyway to prevent this?
2)Meantime, I'm using session on my site as well.Everytime when I click on the 'back' button on the brower I get the following message: WARNING: PAGE HAS EXPIRED/DATA MISSING. Why?
Something you might want to notice:
I'm not the owner of the server, I just put my site for free hosting.
I've tried to use GET method instead, but it doesn't seem to be a good idea since sensitive info such as username and password will be exposed on the address bar in the browser.Any idea?Solutions and helps are much appreciated. Thank you.
I have used two functions in the script:
guestbook.php?function=addcomment
guestbook.php?function=submit
Basically addcomment() function is to show the html form whereas submit() performs the routines
such as form field validation and stores the commments into database.
My question is: supposed when the user finished filling the comments form and clicked on the submit button,
the url will then became guestbook.php?function=submit right? At this point if he/she refreshed the page,
the same data will be submited over and over again since the script continued looping the submit() function.As the result,
the database will be trashed. Is there anyway to prevent this?
2)Meantime, I'm using session on my site as well.Everytime when I click on the 'back' button on the brower I get the following message: WARNING: PAGE HAS EXPIRED/DATA MISSING. Why?
Something you might want to notice:
I'm not the owner of the server, I just put my site for free hosting.
I've tried to use GET method instead, but it doesn't seem to be a good idea since sensitive info such as username and password will be exposed on the address bar in the browser.Any idea?Solutions and helps are much appreciated. Thank you.