How To Create An HTML-PHP Working Contact Form For Your Website

Socialize: 
You Don't Have Need To Any Contact Form Builder Or Provider.
Here Are The Simple & Easy Step To Do.
This Tutorial Will Teach You How To Create A Very Simple Contact Form For HTML Based Website & Blog.

First Of All Create 2 Files:
contactform.html and contact.php.
Then Do As I Say.....
Code for contactform.html:
(Copy Below Text And Paste It On Notepad Then Save It In contactform.html)

<form action="contact.php" method="post" enctype="plain">              
         Name*:</br>
<input type="text" name="Name"  value="Your Name"  size="50"/>
        </br>
</br>
E-mail*:</br>
<input type="text" name="E-Mail"  value="Your E-Mail"  size="50"/>
         </br>
</br>
Message*:</br>
<textarea type="text" name="Message" rows="10" cols="39"  ></textarea>
         </br>
</br>
<input type="submit" value="Send" />
                        <input type="reset" value="Reset" />
</form>


It Looks Like This...........................


Name*:


E-mail*:


Message*:


Code for contact.php:
(Copy Below Text And Paste It On Notepad Then Save It In contact.php)


<?php
$field_name = $_POST['Name'];
$field_email = $_POST['E-Mail'];
$field_message = $_POST['Message'];

$mail_to = 'hassan.exe393@gmail.com';
$subject = '#Message# '.$field_name;

$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$E-Mail."\r\n";
$headers .= 'Reply-To: '.$E-Mail."\r\n";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contactform.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message sending failed. Please, send an email to hassan.exe393@gmail.com');
window.location = 'contactform.html';
</script>
<?php
}
?>

Do Some Changes:
1.) First Change All Red Text As You Want But Keeps Them Same Wording And Same Capitalization Of Letter.
2.) Change Blue Text As You Want, They Are A POP Up Confirmation News After Click On Send Button.
3.) Yellow Highlighted Text Is So Important To Change, Change It Your E-Mail In Which You Want Receive This E-Mail.
4.) Change Pink Text If You Want, It Will Appear On E-Mail Subject.


    You may also like...

  • Simple Image + Text  Slider for Blog

    Simple Image + Text Slider for Blog

    Instructions To Follow:- STEP #1Log in to Blogger, go to Design -> Edit HTML and mark the tick…

  • How To Add Three (3) Column Footer To Blogspot

    How To Add Three (3) Column Footer To Blogspot

    How To Add Three (3) Column Footer To Blogger By using Template Designer ?To add 3 column footer to…

  • How to Make your Blogger Blog ready for Mobile Phones

    How to Make your Blogger Blog ready for Mobile Phones

    As you know, millions of people use their mobile phones to access internet. The mobile internet…

  • How To Add Stylish Borders Around All Blog's Gadget/Widget?

    How To Add Stylish Borders Around All Blog's Gadget/Widget?

     Some time your template is so simple that it can not attract visitors, so you have to spices…

  • How To Add META Tags In Blog And Website

    How To Add META Tags In Blog And Website

    If you don't know what meta tags are, and the importance of adding meta tags, here is the detailed…

  • How To Add Subscribe Feeds Via Email Widget

    How To Add Subscribe Feeds Via Email Widget

    For FeedBurner:-Adding Widget Code :-It's SimpleStep 1 : In that Add Gadget window , choose HTML /…

  • How To Embed "SWF,FLV" Files Into Your Blog And Website

    How To Embed "SWF,FLV" Files Into Your Blog And Website

    Nowadays flash files are widely used in web and blog developing and designing, they not only give a…

No comments:

Post a Comment

About Me

Hi, I am Muhammad Saalim, Co-Founder of EXEIdeas International and CEO of bord4banned. I am here to share my experiences with you and to help those who can help themselves.

Follow Me



Join Our Official FaceBook Group To Stay With Us.

Caution!

All data, codes, articles, tips and tricks etc, posted here are copyright work of MyTutspot.Blogspot, and are protected with DMCA. Any one, found to be thefting any data, will be under LEGAL ACTION.

My Tutspot.Blogspot 2018 All Rights Reserved
Designed by born4banned | A Project of EXEIdeas International