Currently in my website the "Title" is dynamically created in php using several variables from my Mysql database.
The problem I'm having is that depending on the particular section of the website i'm on, I would like to slightly adjust the title formating.
Here is what I was testing with the following code:
So far here is what happens:
$urlcustom = $_SERVER['SERVER_NAME'];
$pagecustom = $_SERVER['REQUEST_URI'];
$webpagecustom = "http://".$urlcustom.$pagecustom;
if($webpagecustom == "http://www.mydomain.com/")
echo "Welcome to mydomain.com";
elseif ($webpagecustom == "http://www.mydomain.com/sitesearch/$searchid/$searchlink")
echo "Search results from Mydomain.com";
elseif ($webpagecustom == "http://www.mydomain.com/sitesection/$browsecat/$ppage/$category")
echo "Browsing $category on Mydomain.com";
echo "$pagetitle on Mydomain.com";
1. When on mydomain.com it displays the correct text from the IF statement.
2. When on mydomain.com/anythingelse it only displays the last Else statement.
3. Basically the IF statement works and the ELSE statement works but none of the ELSEIF statements work.
I can't exactly see the reason why it only outputs the last else statement instead of displaying the correct one. I'm not exactly sure how to change the elseif statement so that it works correctly.
I'm guessing it's because of the URL's being generated from php, but I've been googling for hours and not exactly sure if i'm even on the right path lol.
Any advice and feed would be greatly appreciated.
Thank you in advance.