Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2010

    Form if yes redirect if no redirect

    I want a form to have 2 options.

    Have you read Tos?
    Option 1: Yes - if okay redirect to shop.
    Option 2: No - if okay redirect to tos.

  2. #2
    Join Date
    Apr 2008
    Montreal, Qc., Canada
    That is very vague.

    You could use a drop down menu, but "Yes" or "No" is generally more user friendly :

    PHP Code:
    <h1>Have you read Tos?</h1>
    h2><a href='shop.html'>Yes</a> or <a href='TOS.html'>No</a></h2
    Note that you could just as well drop a cookie on visitor's machine when he visits your TOS and then verify, on your index/shop page, whether the cookie exists or not.
    Heymman - Beefy servers, tiny price !

  3. #3
    This will be a very basic script, so please use proper security measures if you implement this...

    HTML snippet:

    <form action="" method="post">
    <!-- form options -->
    <input type="radio" name="tos_check" value="yes" /> I have read the TOS<br />
    <input type="radio" name="tos_check" value="no" /> I have not read the TOS

    PHP snippet:


    // rest of script

    if ($_POST['tos_check'] == 'yes') {
    header('Location: /shop');
    } elseif ($_POST['tos_check'] == 'no') {
    header('Location: /terms');

  4. #4
    Or use a simple checkbox instead. Unchecked by default. Cleanest option.

  5. #5
    Join Date
    Jun 2011
    a check box and a javascript will do..

Similar Threads

  1. Registrar redirect vs Server redirect?
    By acctman in forum Dedicated Server
    Replies: 2
    Last Post: 03-26-2011, 05:52 PM
  2. Post to Form from PHP and follow redirect
    By SimonT in forum Programming Discussion
    Replies: 16
    Last Post: 08-05-2008, 08:17 AM
  3. form to PayPal redirect with price variable
    By FG-alex in forum Programming Discussion
    Replies: 2
    Last Post: 01-21-2008, 11:19 PM
  4. How to redirect after form post?
    By deko in forum Hosting Security and Technology
    Replies: 5
    Last Post: 06-12-2006, 09:05 PM
  5. how to make list/menu form option redirect on click?
    By CoryPippen in forum Programming Discussion
    Replies: 6
    Last Post: 05-03-2004, 09:33 AM

Posting Permissions

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