duta
asked on
PHP Survey Form and Disabling Back button in web browser
Hi experts (and geniuses)!
I have a PHP survey form. People may fill out the form on the "page1.php" and preview the input by clicking "Submit button at bottom (in other words, once "Submit" button is clicked, preview page is displayed). The preview page has two buttons: 1. Proceed (to finally submit) and 2. "Edit" (to go back to "Page1.php" to make changes).
My question is: Is there a way to make it impossible to go back to the "Page1.php" once "Proceed" button is clicked?
I do remember that when I tried to go back to the previous page in some web sites like Paypal or Amazon.com", I could not go back to the previous page. Instead a message showed on light gray screen, saying some messages (whose words I could not remember).
You might ask why I need to do that. The answer is: Some people submitted more thahn once, going back and forth between "Page1.php" and preview.php. Currently, anyone may submit as many as he/she wants: It could be a major problem for me.
Thanks a lot!
I have a PHP survey form. People may fill out the form on the "page1.php" and preview the input by clicking "Submit button at bottom (in other words, once "Submit" button is clicked, preview page is displayed). The preview page has two buttons: 1. Proceed (to finally submit) and 2. "Edit" (to go back to "Page1.php" to make changes).
My question is: Is there a way to make it impossible to go back to the "Page1.php" once "Proceed" button is clicked?
I do remember that when I tried to go back to the previous page in some web sites like Paypal or Amazon.com", I could not go back to the previous page. Instead a message showed on light gray screen, saying some messages (whose words I could not remember).
You might ask why I need to do that. The answer is: Some people submitted more thahn once, going back and forth between "Page1.php" and preview.php. Currently, anyone may submit as many as he/she wants: It could be a major problem for me.
Thanks a lot!
ha
this will be better:
if(isset($_SESSION['proced ed'])){
header("Location:somePageY ouWant.php ");
}
;-)
this will be better:
if(isset($_SESSION['proced
header("Location:somePageY
}
;-)
ASKER
TO: ljubiccica :
Thank very much for your kind, prompt response.
I tried your scripts, but it did not work.
Can you create and post here a very simple pages so that I may test it?
For your info, my pages are as follows:
Page 1 has "preview" button and reset button.
preview page has "proceed" button and "edit" button.
What I would like to do is: Once a person finished previewing the page and click "proceed" button, he may be able to go one page back to page1 so that he may not be able to submit again and again and again.
Thank very much for your kind, prompt response.
I tried your scripts, but it did not work.
Can you create and post here a very simple pages so that I may test it?
For your info, my pages are as follows:
Page 1 has "preview" button and reset button.
preview page has "proceed" button and "edit" button.
What I would like to do is: Once a person finished previewing the page and click "proceed" button, he may be able to go one page back to page1 so that he may not be able to submit again and again and again.
Ok...
will do it in a moment...
will do it in a moment...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
TO: ljubiccica
Thank you so much for your very kind help.
I will test yur script and come back to you as soon as possible.
I will writing this message upon checking your post.
Thanks again!
duta
Thank you so much for your very kind help.
I will test yur script and come back to you as soon as possible.
I will writing this message upon checking your post.
Thanks again!
duta
ASKER
TO: ljubiccica :
Thank you very much for your kind script.
Yur scripts worked just fine. But there is a problem: I could re-submit the form after closing and re-opening a web browser. I just wonder whether there is a solution to this.
Thanks!
duta
Thank you very much for your kind script.
Yur scripts worked just fine. But there is a problem: I could re-submit the form after closing and re-opening a web browser. I just wonder whether there is a solution to this.
Thanks!
duta
Do you use any mysql database?
Look, there is no 100% way you can do it...
You can make a cookie with php -> but a smart user can always delete cookies and he may re-submit the form again.
The other way is you make a field in your form like e-mail address, write it into database and you check this address before the user submits his form.
The third way is to block IP, but i wouldn't do that because sometimes more people (maybe 1000 or more) use the same IP address...
So if you combine first two you will make a good work... But even then you will have some "web experts" that will be able to go around it...
Look, there is no 100% way you can do it...
You can make a cookie with php -> but a smart user can always delete cookies and he may re-submit the form again.
The other way is you make a field in your form like e-mail address, write it into database and you check this address before the user submits his form.
The third way is to block IP, but i wouldn't do that because sometimes more people (maybe 1000 or more) use the same IP address...
So if you combine first two you will make a good work... But even then you will have some "web experts" that will be able to go around it...
ASKER
TO: ljubiccica :
Thank you so much for your very kind, prompt response.
I will try the others things you recommended for me and come back to you asap.
Thanks again!
duta
Thank you so much for your very kind, prompt response.
I will try the others things you recommended for me and come back to you asap.
Thanks again!
duta
On the second page you make a session like $_SESSION['proceded']=true
And than on the first page, before you do anything else you do this
if(isset($_SESSION['proced
header("Location:somePageY
}
You know how to strat with sessions and everything?
Ljubiccica