SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy hot 2 clear page whn u hit back button

    Hi am new to PHP.

    I hve dne a feedback form. And it wrks fine.

    But the browser can go back n keep on re-submitting the form over n over since the page is not cleared when u jit the bck button.

    How can u solve this.... HELP

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You don't have control over this. Even if you try to do something fancy here, the user can always hit the autofill button on their Google toolbar or similar...

    Why do you want to stop someone from submitting the feedback form more than once?

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If i have understood your problem, simply redirect the page to the desired page after submitting is successful. You can use
    PHP Code:
    header("Location:yourlink.php"); 
    Does this make any sense of your problem?
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Member
    Join Date
    May 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well like Rajug has suggested, i do have a php form to post the data into my email address.

    But still the browser is able to go back and re-submit.

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by PHP-POWER View Post
    Well like Rajug has suggested, i do have a php form to post the data into my email address.

    But still the browser is able to go back and re-submit.
    What would you like to happen? Nobody can ever contact you more than once? What if they forgot a detail in the original message and want to follow up?

  6. #6
    SitePoint Member
    Join Date
    May 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The issue is that i keep getting about 50 mails. On the same details. The form works fine. But there are a few jobless surfers who keep hitting back button and re-submitting the form.

    All i want is for this to stop. I think if we make him/her refill the form the number of submits will reduce.

    I hope u understoon what i mean....

  7. #7
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    set a timer to stop them submitting the form more than once an hour.
    Add a hidden form field with a timestamp and compare that timestamp to a preset hour interval. If the interval is less, dont run the email.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  8. #8
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Are they real mails or spam?

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Just as a side note (and this goes for anyone who is wondering about header("location:...") calls), if you log into your hotmail account and then Sign Out, you can still hit back in the browser and access the main mail page. So header("Location: ) isn't really a good 'security' solution.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  10. #10
    SitePoint Member
    Join Date
    May 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ALL JUNK mail.. Invalid data fields..

    But SPIKE, will others be able to submit the form during that time??

  11. #11
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    should be able to, if you really want to make sure add a link identifier that matches the current form submission or use a session variable.

    Thinking about it, why not just add a CAPTCHA to your form?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  12. #12
    SitePoint Member
    Join Date
    May 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think the only solutions would be that having the form on a popup window.

    This way no hitting back button and once the form is posted through the php script. the popup window shud be auto closed or shoud have a close button.

    what do you say???


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •