Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3874 | Replies: 1
![]() |
•
•
Join Date: Mar 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I am new in PHP and I am trying to work with a simple if statement with 3 radio buttom where each one go to a different page. I am not sure if I am doing the correct way. Can anyone help me with an if statement?
Here is what I have in my code:
index.php
<form name="" method="post" action="evaluate.php">
<input name="yesno" type="radio" value="yes"></td>
<td>Yes</td>
<input name="yesno" type="radio" value="no"></td>
<td>No</td>
<input name="yesno" type="radio" value="other"></td>
<td>No</td>
<input type="submit" name="Submit" value="Submit">
</form>
------evaluate.php-----
<?php
$create = new result();
$create->AddDBParam('yesno',$_POST[yesno]);
$createResult=$create->FMView();
$yesno=$_POST['yesno'];
?>
<?php
if($yesno == "yes")
{
header("Location: test01.php " );
}
if($yesno == "no")
{
header("Location: test02.php " );
}
if($yesno == "other")
{
header("Location: test03.php " );
}
?>
thank you,
msei :-|
I am new in PHP and I am trying to work with a simple if statement with 3 radio buttom where each one go to a different page. I am not sure if I am doing the correct way. Can anyone help me with an if statement?
Here is what I have in my code:
index.php
<form name="" method="post" action="evaluate.php">
<input name="yesno" type="radio" value="yes"></td>
<td>Yes</td>
<input name="yesno" type="radio" value="no"></td>
<td>No</td>
<input name="yesno" type="radio" value="other"></td>
<td>No</td>
<input type="submit" name="Submit" value="Submit">
</form>
------evaluate.php-----
<?php
$create = new result();
$create->AddDBParam('yesno',$_POST[yesno]);
$createResult=$create->FMView();
$yesno=$_POST['yesno'];
?>
<?php
if($yesno == "yes")
{
header("Location: test01.php " );
}
if($yesno == "no")
{
header("Location: test02.php " );
}
if($yesno == "other")
{
header("Location: test03.php " );
}
?>
thank you,
msei :-|
Last edited by msei : Mar 28th, 2005 at 4:30 pm. Reason: mispelling
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 1
<form name="" method="post" action="evaluate.php">
<input name="yesno" type="radio" value="yes"></td>
<td>Yes</td>
<input name="yesno" type="radio" value="no"></td>
<td>No</td>
<input name="yesno" type="radio" value="other"></td>
<td>Other</td>
<input type="submit" name="Submit" value="Submit">
</form>
<?php
if (isset($_POST['yesno']))
{
$yesno=$_POST['yesno'];
if($yesno == "yes")
{
header("Location: test01.php " );
}
if($yesno == "no")
{
header("Location: test02.php " );
}
if($yesno == "other")
{
header("Location: test03.php " );
}
}
?>
<input name="yesno" type="radio" value="yes"></td>
<td>Yes</td>
<input name="yesno" type="radio" value="no"></td>
<td>No</td>
<input name="yesno" type="radio" value="other"></td>
<td>Other</td>
<input type="submit" name="Submit" value="Submit">
</form>
<?php
if (isset($_POST['yesno']))
{
$yesno=$_POST['yesno'];
if($yesno == "yes")
{
header("Location: test01.php " );
}
if($yesno == "no")
{
header("Location: test02.php " );
}
if($yesno == "other")
{
header("Location: test03.php " );
}
}
?>
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode