0

Hi, I am trying to create a page where depending on which one of three radio buttons is selected something different happens. The context is that users have already registered and so the 'gigname' is taken from url (which seems to work now).

The original url looks like example.com/listtype.php?name=gigname (with the correct gigname appearing).

However instead of doing what it is supposed after submit the url just changes to example.com/listtype.php?type=(and in here the value appears from the chosen radio button).

I do not know what is going wrong so any help would be appreciated, here is the code:

<?

$gigname = $_GET['name'];

?>

<form>
Listing type: <input type="radio" name="type" value="free">Free<br>
<input type="radio" name="type" value="premium">Premium<br>
<input type="radio" name="type" value="featured">Featured<br>
<input type="submit" />
</form>

<? 

if(isset($submit) && isset($free))
{
header ("Location: http://www.example.com/gig.php?name=' . $gigname . '");
}
elseif(isset($submit) && isset($premium))
{
echo 'do something else';
}
elseif(isset($submit) && isset($featured))
{
echo 'do another thing';
}
elseif(isset($submit) && !isset($free) && !isset($premium) && !isset($featured)) {
 echo 'please make a selection';
}

?>

Thanks in advance

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by gilgil2
0

Is this what you need?

<form>
Listing type: <input type="radio" name="name" value="free">Free<br>
<input type="radio" name="name" value="premium">Premium<br>
<input type="radio" name="name" value="featured">Featured<br>
<input type="submit" />
</form>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.