I'm writing a send to a friend script which sends the URL of a webpage to an email address that the user puts into a form.
I'm having trouble getting the URL of the page if it is something like articles.php?category=news
I can handle simple filenames fine like articles.php works no problem.
$dirandfile = basename($_SERVER['PHP_SELF']);
$domain = $_SERVER['SERVER_NAME'];
$url = "http://$domain/$dirandfile";
How can I get my script to handle these url's?