Jump to content

Forms Q?


jwk811

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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.