Something is wrong with my code. No matter what the $_SERVER['REQUEST_URI']
value is, gkPageContent
is always displayed.
if (strpos($_SERVER['REQUEST_URI'], "online") >= 0) {
$left_col_class = "gkPageContent";
}
elseif(strpos($_SERVER['REQUEST_URI'], "student-login") >= 0) {
$left_col_class = "showme";
echo "this is not sanjay";
}
elseif(strpos($_SERVER['REQUEST_URI'], "my-account/orders") >= 0) {
$left_col_class = "showme";
}
elseif(strpos($_SERVER['REQUEST_URI'], "my-account/my-courses") >= 0) {
$left_col_class = "showme";
}
elseif(strpos($_SERVER['REQUEST_URI'], "my-account/fourm") >= 0) {
$left_col_class = "showme";
}
elseif(strpos($_SERVER['REQUEST_URI'], "student-login") >= 0) {
$left_col_class = "showme";
}
elseif (strpos($_SERVER['REQUEST_URI'], "student-login") >= 0) {
$left_col_class = "showme";
}
else{
echo "dam thing";
}
echo $left_col_class;
Here's a demonstration.
Why isn't strpos()
evaluating the string as intended?