i have:
[syntax=php]<form action='index.php?act=music&action=a100b22847a2' method='POST'>
<select name='filter_options'>
<option> View Filter </option>
<option value="filter_allmusic">All Music</option>
<option value="filter_mymusic">My Music</option>
</select>
<input type='submit' name='change_filter' value='Go' />
</form>
</div>
<div style='clear: both;'></div>
<br />
<?php
$submit = $_POST['change_filter'];
$mymusic = $_POST['filter_mymusic'];
$allmusic = $_POST['filter_allmusic'];
if(!$submit)
{
if($mymusic)
{
echo "MY MUSIC";
}
else if ($allmsuic)
{
echo "ALL MUSIC";
}
}
?>[/syntax]
but it isn't detecting wether they selected my music or all music on the form.. where am i going wrong.. thanks
What am i doing wrong?
What am i doing wrong?
I would put a signature.. BUT, i don't have the time.
Re: What am i doing wrong?
you need to check the value of $_POST['filter_options'] ie
[syntax=php]if (isset($_POST['filter_options']) && $_POST['filter_options'] === 'filter_mymusic'){
// my music
}else{
// all music.
}[/syntax]
[syntax=php]if (isset($_POST['filter_options']) && $_POST['filter_options'] === 'filter_mymusic'){
// my music
}else{
// all music.
}[/syntax]