Thread: Contact Form
View Single Post
12-13-2005, 03:33 AM
#6
Shawon is offline Shawon
Shawon's Avatar
Status: Request a custom title
Join date: Nov 2004
Location: New York City
Expertise:
Software:
 
Posts: 1,164
iTrader: 0 / 0%
 

Shawon is on a distinguished road

Send a message via AIM to Shawon Send a message via MSN to Shawon

  Old

heres one i use, simple

PHP Code:
<?php
                    $name 
$_POST['name'] ;
                    
$email $_POST['email'] ;
                    
$subject $_POST['subject'] ;
                    
$message $_POST['message'] ;
                    
                    if (!isset(
$_POST['name'])) {
                
?>
                <form method="post" action="<?php echo("$php_self"); ?>">
                    Name:<br />
                    <input name="name" type="text" style="margin: 0px 0px 5px 0px;" /><br />
                    Email:<br />
                    <input name="email" type="text" style="margin: 0px 0px 5px 0px;" /><br />
                    Subject:<br />
                    <input name="subject" type="text" style="margin: 0px 0px 5px 0px;" /><br />
                    Message:<br />
                    <textarea name="message" rows="" cols="" style="margin: 0px 0px 5px 0px;"></textarea><br />
                    <input name="send" type="submit" class="submit" value="Send" alt="Send" />
                </form>
                <?php
                    
}
                    elseif (empty(
$name) || empty($email) || empty($subject) || empty($message)) {
                    echo(
"<p>Please fill out the form completely!</p>");
                    }
                    else {
                    
mail("likuidsmoke@gmail.com","$subject","$message","From: $name <$email>");
                    echo(
"<p>Your email has been sent, allow a few days for a response. Thank you!</p>");
                    }
                
?>
just replace likuidsmoke@gmail.com with your email and on the mail() function it goes "email to send to","subject of email","body of email","from part"

and u can add more fields to it just add it into the php part and make a field for it on the form