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!
User input to determine redirect/ link I need the code for if the user enters in a co
Collapse
X
-
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'); ?>
-
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
-
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
Comment