Jump to content


Photo

Forms Q?


  • Please log in to reply
1 reply to this topic

#1 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 26 August 2006 - 07:12 AM

Is there a way you can send someone to page after a form depending on what they entered into it? Like if the chose one thing then it will send them to this page or if they select one thing it will bring them to another page. It seems like something that would be used else where but it doesn't seem possible to be able to bring that data to either page knowing that you can make only one action on the form.

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 26 August 2006 - 07:18 AM

form.htm-
<form action="reffer.php" method="POST">
<input type="radio" name="page" value="1">Page 1<br>
<input type="radio" name="page" value="2">Page 2<br>
<input type="radio" name="page" value="3">Page 3<br>
</form>

reffer.php-
<?php
if(isset($_POST['page'])){
switch($_POST['page']){
case 1:
header("Location: page1.php");
break;
case 2:
header("Location: page2.php");
break;
case 3:
header("Location: page3.php");
break;
}
}
?>

Orio.
Think you're smarty?

(Gone until 20 to November)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users