Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

IF "page" THEN


wex

Recommended Posts

Hello OSC users,

 

In my previous thread, i wrote about determing whether you are on the front page.

(http://www.oscommerce.com/forums/index.php?showtopic=288759&st=0&p=1188983entry1188983)

 

And it was answered.

 

I wrote about how you would do it to individuel pages, and got a response with(thanks Babygurgles for helping):

 

$curfile = str_replace('/', '', $_SERVER['PHP_SELF'];
switch($curfile) {
 case($curfile == FILENAME_CONTACT_US):
 // Do this in the contact us page
 break;
 case($curfile == FILENAME_CHECKOUT_SHIPPING):
 // Do this in the shipping page
 break;
 //case($curfile == XXXXXX):
 // Do this in the XXXXXX page
 //break;
}

 

I cant understand how to get it to work, i just get clean/error page.

 

Someone might be able to fix/tell me how to make it work?

 

Regards

Marco "wex" Johannesen

Link to comment
Share on other sites

$curfile = str_replace('/', '', $_SERVER['PHP_SELF'];

Is wrong

 

Should have been ..

 

$curfile = str_replace('/', '', $_SERVER['PHP_SELF']);

 

Sorry

Link to comment
Share on other sites

This is cleaner (I must have been a bit drunk :) )

 

$curfile = basename($_SERVER['PHP_SELF']);
switch($curfile) {
  case($curfile == FILENAME_CONTACT_US):
			 // Do this in the contact us page
  break;
  case($curfile == FILENAME_CHECKOUT_SHIPPING):
			 // Do this in the shipping page
  break;
			 //case($curfile == XXXXXX):
			 // Do this in the XXXXXX page
			 //break;
  default:
			 // Do nothing
}

Link to comment
Share on other sites

Hmmm...

 

Thank you yet again Babygurgles.

 

You are truely a helpfull person.

 

 

I wish you a great weekend and thank you very much! :)

 

 

Regards

Marco "wex" Johannesen

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...