Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to get the current page's url


Jack_mcs

Recommended Posts

I have the following code in includes/header.php. The intention is to find out which page is currently active. But the switch always ends up in default. Would someone please point out my problem or a better way to do it?

 

$parsed = parse_url($REQUEST_URI);

$parsed = $parsed['path'];

 

switch ($parsed) {

case "/shipping.php":

echo 'ship';

break;

case "/about.php:

echo 'about';

break;

default:

echo 'default';

break;

}

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...