I'm trying to figure out to show a panel on a page based upon the url.
i've tried
if ($_SERVER['PHP_SELF'] == profile.php) {
echo "coding"
}
and it just shows it on everypage. I am using this in my header page for a menu
Show depending on page
Moderator: General Moderators
-
shawngoldw
- Forum Contributor
- Posts: 212
- Joined: Mon Apr 05, 2010 3:38 pm
Re: Show depending on page
I am not sure if this is a complete solution, but the proper way to compare strings is:
If it equals 0 then the strings are the same
Shawn
Code: Select all
strcmp($str1, $str2) == 0
Shawn
Re: Show depending on page
$str1 = $_SERVER['PHP_SELF'];
$str2 = "users.php?id=" . $_GET[id];
if (strcmp($str1, $str2) == 0) {
echo "test<br>";
echo $_SERVER['PHP_SELF'];
}
Doing it like this still shows the information all the time on every page
$str2 = "users.php?id=" . $_GET[id];
if (strcmp($str1, $str2) == 0) {
echo "test<br>";
echo $_SERVER['PHP_SELF'];
}
Doing it like this still shows the information all the time on every page