Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Contact form for you HTML+PHP

So, I decided to share some thing with you, and I am continuing.

You can probably find better script if you google, but if you are looking for light working contact form, this is for you.

PHP Code

<?php 
PHP Code
:
<?
php
if($_POST["email"]<>'') {
    
$ToEmail = '[email protected]'; //Put your email here 
    
$EmailSubject = 'CONTACT'; // Title of email
    
$mailheader = "From: ".$_POST["email"]."\r\n";
    
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
    
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
    
$MESSAGE_BODY = "<b>Name</b>: ".$_POST["name"].""."<br>"; //name
    
$MESSAGE_BODY .= "<b>Email address:</b> ".$_POST["email"].""."<br>"; //from
    
$MESSAGE_BODY .= "<b>Question:</b> ".nl2br($_POST["comment"]).""."<br>"; //text
    
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
Message sent. <!--Message which is printed if the email has been sent. You can change it or delete it-->
<?php
} else {
?>
<form action="" method="post">
<table width="400" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="29%" class="bodytext">Name:</td>
<td width="71%"><input name="name" type="text" id="name" size="32"></td>
</tr>
<tr>
<td class="bodytext">Email address:</td>
<td><input name="email" type="text" id="email" size="32"></td>
</tr>
<tr>
<td class="bodytext">Question:</td>
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</form>
<?php
};
?>


Possibly Related Threads...
Thread / Author Replies Views Last Post
by MastersAug 25, 2024 10:05 AM 5 178 Aug 25, 2024 10:05 AM
Last Post: Masters
[Wordpress] by Bru6May 25, 2021 10:18 AM 0 147 May 25, 2021 10:18 AM
Last Post: Bru6
by © ÉliXéd_Jan 31, 2021 09:40 AM 4 169 Jan 31, 2021 09:40 AM
Last Post: FlashyBeach