Reply to Re: Sending email to friend about a page

Your name:

Reply:


Posted by Sean on 03/19/07 12:17

"Steve" <cdriver24@comcast.net> wrote in message
news:bsudnQL9AP-_-GDYnZ2dnUVZ_u6rnZ2d@comcast.com...
> Hi I need some help in creating php code for sending an email to a
> friend about a particular page on a website. I want the code to send the
> url for what ever specific page the client is on and wants their friend to
> see. Is that possible with php coding?
>
>
> Thanks Steve
>

Yes.

I am sure you can put the following on a HTML page, where you want to put
the button...

<script language="Javascript">
document.write "<FORM action='email.php' method='post'>";
document.write "<INPUT name='url' type='hidden' value='" + location.href +
"'>";
document.write "<INPUT name='email' type='text' value=''>";
document.write "<INPUT name='submit' type='submit' value='Send Link'>";
document.write "</FORM>";
</script>

Then create the"email.php" page, for which it wouldn't be a lot different
from:

<?php
$email = $_POST['email'];
$url = $_POST['url'];
$headers = "From: info@mycompany.com \r\n";
$headers.= "Content-Type: text/html; charset=ISO-8859-1 ";
$headers.= "MIME-Version: 1.0 ";
$body = "Check out this website\r\n";
$body.= $url;
$body = "Thanks\r\n";
$body = "From ...\r\n";
mail($email, "Check out this page", $body, $headers);
?>
<!-- Add some HTML here so that they know it's been emailed and perhaps a
link back to the previous page -->


GOOGLE for PHP MAIL for more information on the email functions in PHP




Hope that helps.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация