Display Content Dependent on URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andy20
    New Member
    • Oct 2009
    • 2

    Display Content Dependent on URL

    Hello,

    Please could somebody shed a little bit of light on whether this is possible. Basically I have a shopping cart system that provides one skin file to layout everypage. Now I want to display different elements on different pages and I thought the best way to do this would be using the URL as this clearly identifies which page is which.

    I am reasonably new to PHP and wondered if somebody could help. An example is below:

    IF URL = www.andysite.co .uk/page-one.php THEN DISPLAY this bit of code ELSE display that bit of code

    Hope you understand, look forward to your response and thanks for having a look,

    Cheers,
    Andy
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    check out the $_SERVER superglobal, esp. $_SERVER["REQUEST_UR I"]

    Comment

    Working...