Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A PHP question


deathgod

Recommended Posts

Hello all. I need your help and a solution needs someone who has better knowledge of PHP than me.

 

I am trying to move the customer greeting to the header but i don't want it showing up on every page, only the index page. This is the best code i can do:

 

<?php

 

$url = $_get[current url];

 

if $url = 'http://www.mydomain.co.za/'

echo tep_customer_greeting();

?>

 

all i need to know is how to assign the $url variable to the current page being viewed.

 

thanks

nick

Menou and unome

Link to comment
Share on other sites

deathgod,

 

Look for... echo tep_customer_greeting... in program catalog/index.php...If you go up a few line you will see an this

 

<?php

} else { // default page

?>

This else controls when the greeting will show...is where you need to

build the logic...

I hope this helps.

Roman

Link to comment
Share on other sites

sorry roman, it is not what i am looking for.

 

in fact i am moving the tep_customer_greeting function from there to the header. i have got everything figired out but there is just one thing i need to know

 

how do you assign the current page being viewed to a variable? my attempt is $url = $_GET(current_url); i imagine it will be something very similar to this

 

thanks for trying though

Menou and unome

Link to comment
Share on other sites

hey thanks mark,

i just found it in php manual and came to post, guess i should have checked here first :)

 

the statement looks like this now

<?php

 

$url = $_server['PHP_SELF'];

 

if $url = '/index.php' //'PHP_SELF' displays the name of the file its in but not the path

echo tep_customer_greeting();

?>

 

thanks to those who helped

nick

Menou and unome

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...