create-php-contact-page-for-visitor-feedback

Create php contact page for visitor feedback

Hi, I think you like my tutorial , Today we make a contact page with php .It has many way to create a contact page . We choose the easy way .So don’t lost our time to talk

Why need a contact page ?

Contact page is very important thing for Website/blog . because It send the visitor feedback to the site admisitrator.So the administrator be aware of problem and solve this .

simple-php-contact-form

By the way , Now we create a html page and a form that’s has 2 text box , 1 textarea and 2 button .

<html>
<head><title>Easily create php contact page</title></head>
<!–www.techfar.com–>
<body>
<form action=”mail.php” method=”POST”>

<p>Name</p> <input type=”text” name=”name”>
<p>Email</p> <input type=”text” name=”email”>

<p>Message</p><textarea name=”message” rows=”8″ cols=”25″></textarea><br />

<input type=”submit” value=”Send”><input type=”reset” value=”Clear”>
</form>
</body>
</html>

 

NameEmail Message

Save it named feedback.html or index.html

Note: Look’s carefully , you see name = “name” , name= “email” , name=”message” . that’s name call the php page’s name . form action=”mail.php” . Here mail.php is the name of php page . method =”post” for url security .

Now we create a php page like look’s below …


 

Save it named mail.php

Note:

  • $name = $_POST['name']; = it collect name from html page
  • $email = $_POST['email']; = it collect email from html page
  • $message = $_POST['message']; = collect message from html page
  • $formcontent variable contain 2 variable that indicate where the message from
  • $recipient = here put your mail address
  • $subject variable is show the recipient mail subject

If all info is correct , the message your mail by the code [ mail($recipient, $subject, $formcontent, $mailheader) ] and show “Thank You!, your message send successfully “

Or all info is incorrect show error message by the code [die("Error ]

After that , we put those file (feedback.html and mail.php ) in folder . Rename to the folder is contact. Now we upload folder to root or other directory. After upload go to http://yoursite.com/contact/ . Now the form is ready for sending mail .try it ….

Note:

1. wrote the php code carefully
2. If mail not send you sure that your server is enable for mail function .

If you fetch any problem :-( about that please comment

Demo Download Now

Comments
  1. ugg boots

    What’s up, I check your blog daily. Your humoristic style is awesome, keep it up!

  2. ugg boots uk

    Hi there, I read your blog daily. Your writing style is witty, keep up the good work!

  3. louis vuitton outlet

    Hi, I check your blogs daily. Your story-telling style is awesome, keep doing what you’re doing!

  4. Rana

    nice tutorial ! carry on man

  5. It is really a great and useful piece of information. I am happy that you shared this helpful information with us. Please keep us up to date like this. Thank you for sharing.

  6. I believe that is among the such a lot significant information for me. And i am glad studying your article. But wanna statement on some general things, The website taste is wonderful, the articles is in point of fact nice : D. Good job, cheers

ADD YOUR COMMENT

*
CommentLuv badge
Close
Free Tutorial for you !
If you like this site , like and stay for new amazing tutorial !!

Twitter

Facebook

Google+