if the above code was in a php page, you could add a hidden form field (let's call it url), then in the value place this
PHP Code:
<?php echo $_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; ?>
That will display the full url of the webpage the user is viewing.
After that, make the php page (lets call it "sendurl.php"). Below is a template of that.
PHP Code:
<?php
//request all data from html form and assign variables for them
$vname = $_REQUEST[visitor];
$vemail = $_REQUEST[visitormail];
$fname = $_REQUEST[friend];
$femail = $_REQUEST[friendmail];
$message = $_REQUEST[notes];
$url = $_REQUEST[url];
$to = $femail;
$subject = "Check out this webpage";
$msg = 'Dear '.$fname',';
$msg .= $vname.' has sent a webpage link for you to see, and they also sent a message. The url to the webpage is '.$url.' and the message is below!';
$msg .= ' ';
$msg .= $message;
$from = $vname.' <'.$vemail.'>';
mail($to, $subject, $msg, $from); //send the message
header('Location: '.$url); //redirect user to page they were at.
?>
I haven't tested this out, but I have wrote something like this before. Let me know if you need any more help.
Bookmarks