jbrill1012
02-16-2012, 05:13 AM
Just wondering how to go about this...
I have 3 radio buttons on a site and depending on which radio button is selected I want it to redirect upon submit to one of three web pages.
such as:
<?PHP
if (isset ($POST[submit1])) {
$which_site = "x,y,z"
if x then 1.php
else if y then 2.php
else if z then 3.php
}
?>
<body>
<form name ="sites" method ="post" action = "$which_site">
<input type ="radio" name ="sites" value ="#">Site 1
<input type ="radio" name ="sites" value ="#">Site 2
<input type ="radio" name ="sites" value ="#">Site 3
<input type ="submit" name ="submit1" value ="Submit">
</form>
Yes I know this would be easier to do with just straight html, but it will help me learn more further along in building other pages for this site. I will later be building more php code that will redirect to a webpage with form output information being pulled from a database. Yes I also know the code above is no where near correct it's just an example of what I think it may look like.
I have 3 radio buttons on a site and depending on which radio button is selected I want it to redirect upon submit to one of three web pages.
such as:
<?PHP
if (isset ($POST[submit1])) {
$which_site = "x,y,z"
if x then 1.php
else if y then 2.php
else if z then 3.php
}
?>
<body>
<form name ="sites" method ="post" action = "$which_site">
<input type ="radio" name ="sites" value ="#">Site 1
<input type ="radio" name ="sites" value ="#">Site 2
<input type ="radio" name ="sites" value ="#">Site 3
<input type ="submit" name ="submit1" value ="Submit">
</form>
Yes I know this would be easier to do with just straight html, but it will help me learn more further along in building other pages for this site. I will later be building more php code that will redirect to a webpage with form output information being pulled from a database. Yes I also know the code above is no where near correct it's just an example of what I think it may look like.