HTML / Web Form Coding to Redirect Based on Field Data

Discussion in 'HTML & Website Design' started by HaveQuestions, Feb 16, 2010.

  1. #1
    Hello,

    I was wondering if anyone knows if it is possible to set-up an Online Form, and Redirect the person Submitting the Form to a Specific Website/page based on what is entered into one specific field - and that I would also be able to use with my current Auto-Responder Service...

    For Example: one Field called "Code#" - someone enters, A123 and Clicks Submit and is Redirected to www.website.com/pageA123.html (for example)

    Thank You!
     
    HaveQuestions, Feb 16, 2010 IP
  2. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You are going to want to use PHP for that. You can use a string truncation and then you can use location.
     
    LeetPCUser, Feb 17, 2010 IP
  3. HaveQuestions

    HaveQuestions Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank You for your reply... unfortunately I have no real knowledge of PHP, but I will look into it.
     
    HaveQuestions, Feb 17, 2010 IP
  4. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Quick way with no truncation of white spaces, but it is a start.

    
    <?php
     $code = $_POST['code'];
     header('location: http://www.yoursite.com/'.$code.'.html');
    ?>
    
    Code (markup):
     
    LeetPCUser, Feb 17, 2010 IP