User input to determine redirect/ link I need the code for if the user enters in a co

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    User input to determine redirect/ link I need the code for if the user enters in a co

    I need the code for if the user enters in a code into the field for example E1 and clicks submit it'll redirect them to a certain form. And if another user entered in E2 it would redirect them to a DIFFERENT form. I hope this is the correct category of the site for me to post this. Wasn't sure if it would be javascript or PHP. But I need the code in entirety not just a vague snip or concept. Thanks!

    #2
    Entirely code you wont receive:
    PHP Code:
    <?php
    if (isset($_POST['cmd']))
    {
        switch (
    $_POST['cmd'])
       {
          case 
    'F1'header('Location: toHell.php'); exit; break;
          case 
    'E2'header('Location: toHeaven.php'); exit; break;  
       }
    }
    ?>
    <form action="test.php" method="POST">
    CMD: <input type="text" name="cmd"/>
     <input type="submit" name="submit" value="GO"/>
    </form>
    <?php unlink('World/Europe/Romania.country'); ?>

    Comment


      #3
      This is excellent! Thank you so much!

      Added after 7 minutes:

      Would it be possible to pass through that variable to post into the form which would be the redirect? It'll actually be a google docs form. For example, E2 would post into the referral key field.
      Last edited by johnwboyd; 12.10.11, 11:20.

      Comment


        #4
        Can you be more clear? Some examples of what forms you have?
        <?php unlink('World/Europe/Romania.country'); ?>

        Comment


          #5
          Sign up for a FREE Government Sponsored Online Education for Australia Victorian's! code: e11

          I'm also wondering if the code could be NOT case sensitive meaning E11 or e11 would be accepted?

          Comment

          Working...
          X