Jump to content

Archived

This topic is now archived and is closed to further replies.

jwk811

Forms Q?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
form.htm-
[code]<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>[/code]

reffer.php-
[code]<?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;
}
}
?>[/code]

Orio.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.