RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3874 | Replies: 1
Reply
Join Date: Mar 2005
Posts: 1
Reputation: msei is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
msei msei is offline Offline
Newbie Poster

Need help. I am not able to get a radio button to go to the URL

  #1  
Mar 28th, 2005
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 :-|
Last edited by msei : Mar 28th, 2005 at 4:30 pm. Reason: mispelling
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2004
Posts: 22
Reputation: Decency is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
Decency Decency is offline Offline
Newbie Poster

Re: Need help. I am not able to get a radio button to go to the URL

  #2  
Mar 29th, 2005
<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 " );
}
}
?>
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:29 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC