SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast qshikuku's Avatar
    Join Date
    Jul 2001
    Location
    Nairobi, Kenya
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    clearing the form details

    Hello People
    2 problems kindly assist

    1.I have a php script that is handling my feedback form details. However after the details have been sent and a thank you page displayed, one can still use the back button of the browser and view the details in the feedback form. How can I expire such details so that after the submit button is pressed the form details are expired??.

    2. How do I use the same Php script to validate the form fields, such that non is left blank and that the email has the @ sign.

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    Check out this thread:http://www.sitepointforums.com/showt...&threadid=3964

    For your second question, in the form, if you have $PHP_SELF in action field such as "action="PHP_SELF" (please check its syntax), and when click submit button, it will execute the same script again. At this time you can check:
    if (!empty(submit))
    {
    //validate and check your input here
    }

  3. #3
    Probably eating pie mitsubishi's Avatar
    Join Date
    Sep 2001
    Location
    England, UK
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) I think telling the browser not to cache should do it. Either headers or meta. Also if your display form and submitted page are the same script I think that works, then you can begin to solve 2) by putting the data back in yourself.

    2) Check out http://www.phpbuilder.com in snippits or http://phpclasses.upperdesign.com for a snippit, you can do it just with a little reg exp but I know one of these has a good snippit which totally validates the address and also looks up mx records to see if the domain is valid.


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
  •