|
Posted by Smitro on 09/14/05 11:35
thelostfaith@gmail.com wrote:
> I've been delving into php for the past two months, and gotten pretty
> good at writing variables and such noonsense.
>
> I was looking to make a mailing form for my website, instead of using
> the crappy mailto:isuck@ophp.com stuff.
>
> Anyone have any ideas as to where I might find this?
>
>
> I'm looking more for something that is as beginner as possible, so that
> I may customize it as I become more accustomed to the language.
>
Hey,
I can understand that the php site is a little
hard to understand to newbies. So a sat down a
wrote this script for you, just to prove how easy
it is. I googled, but all the tutorials looked
real hard, so I thought easier to learn the easier
way.
Have a play with this and let us know how you go.
<html>
<head>
<title>Send Me An Email</title>
<head>
<body>
<?php
if (empty($_POST['submit'])) {
echo "<H3>Send Mail</H3>\n";
echo "Fill in the Form and it will send you an
email.<br>\n";
echo "<form method=post
action='".$_SERVER['PHP_SELF']."'>\n";
echo "Subject: <input type='text'
name='subject'><BR>\n";
echo "Message: <br><textarea name='message'
rows='5' cols='20'>Enter your message
here.</textarea><br>";
echo "<center><input type='submit' name='submit'
value='Send'></center></form>";
}ELSE{
// format and send email.
$to = "you@yourisp";
$subject = $_POST['subject'];
$message = $_POST['message'];
mail ($to, $subject, $message);
echo "Mail Sent!";
}
?>
</body>
</html>
[Back to original message]
|