I'm working on a site with an email form on each page, if possible, I would like it to automatically grab and send the page url to the email address which the form directs to (as a part of the message). Is there any way to do this?
If what you are saying is you want the url of the page from which you are gathering the email info from and from which you end up sending the mail, then I think you mean to use $_SERVER['PHP_SELF'].
Try out with the below code:
<form name="myform" action="<?=$SERVER['PHP_SELF']. "?" . $SERVER['QUERY_STRING'];?>" method="GET">
or could you echo $location; die; after this line:
$location = $_GET['current_url'];
Hope this helps.