You are here: Re: Php mail form « PHP Programming Language « IT news, forums, messages
Re: Php mail form

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>

 

Navigation:

[Reply to this 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

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