I was wondering: I use this code:
if($_GET['rvr_filter_select'] == $qRows) {
$sSelected = 'selected';
}
But in this case when php doesnt get rvr_filter_select it gives a error of a undifined index rvr_filter select
Now I was wondering of this is a valid way to solve this problem. It doesnt output the error anymore but I dont know if it will work the same as the code above:
if(isset($_GET['rvr_filter_select']) == $qRows) {
$sSelected = 'selected';
}
You should use
if(isset($_GET['rvr_filter_select']) && $_GET['rvr_filter_select'] == $qRows)
The isset function returns a boolean: true or false.
Thats not going to work, because you will first validate if the value is set, this will be true of false and then compare it to $qrows, you should do both for best results..
if(isset($_GET['rvr_filter_select']) && $_GET['rvr_filter_select'] == $qRows) {
$sSelected = 'selected';
}
The isset function returns a boolean: true or false.
if(isset($$_GET) && isset($_GET['rvr_filter_select']) && $_GET['rvr_filter_select'] == $qRows){
$sSelected = 'selected';
}
if(isset($_GET['rvr_filter_select']) && trim($_GET['rvr_filter_select']) == $qRows) {
$sSelected = 'selected';
}
else
{
}