2- print this topic script.
<a href="javascript:window.print()">Print this page</a> 3- send this topic to a friend script
When I needed to do this, I basically created a PHP page called 'send2friend.php' which relied on a variable being carried over, in this case the page name that I'm on. As i was only doing this for 3 pages, I thought it easier to manually code the html to do so, I then used open.window to open a popup with that page and the url passed.
<script type="text/javascript">
// Window Open
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script> <a href="#" onClick="MM_openBrWindow('send2friend.php?page=vps-basic','Send2friend','resizable=yes,width=410,height=300')">Send to a friend </a> My send2friend page looks like
[php]
<?
// Send to friend script.. This page will send the given link to a friend
// Carl Pickering - Line3 Internet
// Quick and dirty hack to get a full URL.
$tPAGE = $_GET['page'];
$PAGE = "http://www.domain.co.uk/" . $tPAGE . ".php";
// Send the details
if($_POST['action']=='send') {
// define some variables first
$send_to = $_POST['f_email'];
$y_person = $_POST['y_name'];
$y_email = $_POST['y_email'];
$f_name = $_POST['f_name'];
$subject = "Interesting Link from - $y_person";
$thank_you ="We have passed on the page to - $f_name";
// Build the message
$message = "Hi $f_name ,\n\n";
$message .= "I found this page, and thought it might be of interest\n";
$message .= "Link: $PAGE\n";
$message .= "Let me know what you think, $y_person\n\n\n";
$message .= "You were sent this email because $y_person <$y_email> thought it might be of interest. We do not keep your information";
$mailheaders = "From: $y_person <$y_email> \n";
$mailheaders .= "Reply-To: $y_person <$y_email>\n\n";
// Simple but basic.. Now send the email
mail($send_to, $subject, $message, $mailheaders);
print(" ");
print(" ");
}
?>
[/php]
My form code (change as needed)
[php]
Found something that a friend might be interested in? Fill in the information below to notify them of what you found.
Friends Name:
Friends Email:
Your Name:
Your Email:
Page to be sent:
<? echo "$PAGE"; ?>
Reset
Submit
[/php]