View Single Post
  #2 (permalink)  
Old Oct 23rd, 2007, 07:23
c010depunkk's Avatar
c010depunkk c010depunkk is offline
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: PHP mail() --> Making a Form / Validating Input / Sending a Mail

We'll start by making a simple HTML page:
HTML: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<title>form mail</title>

<style type="text/css" media="all">
* { margin:0;padding:0; }
body { font:600 12px/22px verdana;padding:50px; }
.box, textarea, .button { border:2px solid #6699CC;font:inherit;color:inherit; }
.box { width:250px; }
textarea { width:300px;height:250px; }
.error { color:#DD1100; }
</style>

</head>

<body>

<div class="contact">
    <h1>Contact Us</h1>
    <p>Please fill out the form to contact us. Required fields are marked with a star [*].</p>
    <form name="contact" action="form_mail.php" method="post">
        <p>Name:* <input class="box" type="text" name="name" /></p>
        <p>E-Mail:* <input class="box" type="text" name="email" /></p>
        <p>Subject: <input class="box" type="text" name="subject" /></p>
        <p>Message:*</p><textarea name="message"></textarea>
        <p><input class="button" type="submit" action="submit" value="Send" />
    </form>
</div>

</body>

</html>
Save this code as "form_mail.php."

Last edited by c010depunkk; Oct 23rd, 2007 at 09:34.