Login Register


Simple Contact Form (PHP) filter_list
Author
Message
Simple Contact Form (PHP) #1
Below is a Simple Contact Form, used in PHP.

contact.php
Quote:<table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td><strong>Contact Form </strong></td>
</tr>
</table>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td><form name="form1" method="post" action="send_contact.php">
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="16%">Subject</td>
<td width="2%">:</td>
<td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
</tr>
<tr>
<td>Detail</td>
<td>:</td>
<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input name="customer_mail" type="text" id="customer_mail" size="50"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>

send_contact.php
Quote:<?php

// Contact subject
$subject ="$subject";

// Details
$message="$detail";

// Mail of sender
$mail_from="$customer_mail";

// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='someone@somewhere.com';
$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>

Any Questions or Queries PM me.

YellowKnife

Reply

RE: Simple Contact Form (PHP) #2
Nice job if you wrote this yourself!
[Image: GiXvY27.png]

Reply

RE: Simple Contact Form (PHP) #3
These are old tutorials from my old forum. Thought would be nice to add here.

Reply

RE: Simple Contact Form (PHP) #4
Oh, I see. Nice share though!
[Image: GiXvY27.png]

Reply

RE: Simple Contact Form (PHP) #5
Nice share, I needed something like this.

Reply

RE: Simple Contact Form (PHP) #6
Tables :fuu:

Pretty cool but would be nice to have customized errors for every field.

Reply

RE: Simple Contact Form (PHP) #7
It doesn't have any kind of filtration or securing mechanisms? It doesn't check for a valid e-mail?
And sending as someone from a mail server other than the original host throws red flags to providers and marks them as spam.
[Image: 6tbE9Nw.png]

Reply

RE: Simple Contact Form (PHP) #8
(09-04-2013, 04:32 AM)iPokemon Wrote: It doesn't have any kind of filtration or securing mechanisms? It doesn't check for a valid e-mail?
And sending as someone from a mail server other than the original host throws red flags to providers and marks them as spam.

This exactly. Definitely a good start, OP, but this is flawed and highly vulnerable to spam, leading to HIGHLY slowed messages.

Reply

RE: Simple Contact Form (PHP) #9
(09-04-2013, 04:41 AM)Sydonay Wrote:
(09-04-2013, 04:32 AM)iPokemon Wrote: It doesn't have any kind of filtration or securing mechanisms? It doesn't check for a valid e-mail?
And sending as someone from a mail server other than the original host throws red flags to providers and marks them as spam.

This exactly. Definitely a good start, OP, but this is flawed and highly vulnerable to spam, leading to HIGHLY slowed messages.

There'd be no "slowing" of messages, you'd just have a pretty full spam box if people decided to bot it and use it as an e-mail bomber.

ReCAPTCHA or another CAPTCHA alternative would be a plus too.
[Image: 6tbE9Nw.png]

Reply

RE: Simple Contact Form (PHP) #10
(09-04-2013, 10:53 PM)iPokemon Wrote:
(09-04-2013, 04:41 AM)Sydonay Wrote:
(09-04-2013, 04:32 AM)iPokemon Wrote: It doesn't have any kind of filtration or securing mechanisms? It doesn't check for a valid e-mail?
And sending as someone from a mail server other than the original host throws red flags to providers and marks them as spam.

This exactly. Definitely a good start, OP, but this is flawed and highly vulnerable to spam, leading to HIGHLY slowed messages.

There'd be no "slowing" of messages, you'd just have a pretty full spam box if people decided to bot it and use it as an e-mail bomber.

ReCAPTCHA or another CAPTCHA alternative would be a plus too.

Actually, excessive outgoing messages delays sending. True story, seen it happen.

Reply







Users browsing this thread: