Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A NAME and page URL


ollym

Recommended Posts

Posted

Hi,

 

I have an Anchor on a page called #EXAMPLE . I am linking to it using <A HREF="#example"> however when I check the actual page, the link to the URL is pointing to the wrong place. Its in the form;

 

http://URL_OF_OSCOMMERCE_SITE/#EXAMPLE

 

instead of;

 

http://URL_OF_OSCOMMERCE_SITE/PAGE_WITH_ANCHOR.PHP#EXAMPLE

 

is there a way in oscommerce or php to get the url of the current page rather than having oscomm just use the base url ?

 

Olly

Posted

there is a way yes

you can use superglobals is one way

 

i cant remember which one it is but run this code and it will print them all out on screen and then you can take the one you want to use and put it into your code.

 

<?php

foreach ($_SERVER as $key => $value)

{

echo "[". $key. "] is set to [". $value ."]\n";

echo "<br>";

}

?>

always here to offer some useless advice....

Archived

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

×
×
  • Create New...