Hi Dave
Loving the script still!! Thanks so much. I run the script on a few sites and need a hand with something. I want to print the
http://www.mysite.com on a page on the site so that the text is automatically included in a page, how would i do this?
Regards
Phil
ps. when i try <?php print $config_baseHREF; ?>
all that appears is "/"
Hi
Your two codes retrieve the domain.com and the page url itself. How do you retrieve the url to the folder where the scripts are located. http://www.domain.com/price_tapestry_script_here/
Hi,
Within the Price Tapestry code, I would use the following:
<?php
print "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
?>
That should do the trick!
Cheers,
David.
Hi Phil,
To get the URL of the current page you need to use the PHP superglobal $_SERVER["HTTP_HOST"]. You can also use it in conjuction with $_SERVER["REQUEST_URI"] to get the full path to the current script. Try this example to work out what you need:
<?php
print "http://".$_SERVER["HTTP_HOST"];
print "<br />";
print "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
?>
Hope this helps!
Cheers,
David.