Okay This Might Be a Very Easy Question. I have about 10 pages and I would like them to all display a different set of links (links that are relevant to the page). Unfortunately the pages are created dynamically and they are not static nor can they be. What I would like to do is something like this: if (url == htttp://www.examplesite.com/page1/) { echo <a href=blahblahblah.html>blahblahblah</a> } elseif (url == htttp://www.examplesite.com/page2/) { echo <a href=blahblahblah.html>blahblahblah</a> } etc.etc.etc. Now the only problem I am having is the part with the URL. I know URL needs to be declared as a variable of some sort (god I hope I am saying this right) but I dont know what that variable is. Can someone please break it down to me in laymans terms. Maybe even write me out an example because I looked over some other sites and was completely confused by the code. I would really appreciate the help. Thank you in advance
Maybe this ? <?php if ($_SERVER['SCRIPT_NAME'] == '/page1') { echo '<a href="blahblahblah.html">blahblahblah</a>'; }elseif{ ($_SERVER['SCRIPT_NAME'] == '/page2') echo '<a href="blahblahblah.html">blahblahblah</a>'; }elseif{ ($_SERVER['SCRIPT_NAME'] == '/page3') echo '<a href="blahblahblah.html">blahblahblah</a>'; } ?> PHP: