Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: PHP Contact Form Tutorial

Let users send you feedback about your website

Tutorial Details:

PHP/MySQL and Visual Basic with easy online tutorials

If you would like to know how i can use the variables above, then checkout the php section for "How to use forms".

Now, all of that information is going to get sent to the contact.php. There, we need to sort all of the information out first, and then we need to prepare for the mail();

PHP Code
//your email address
$site_email = "contactform@yourwebsite.com" ;
//the info will come in as $_POST
$name = $_POST [ 'name' ];
$email = $_POST [ 'email' ];
$message = $_POST [ 'message' ];
if(!empty( $name ) && !empty( $email ) && !empty( $message ))
{
$subject = "Contact Form" ;
$headers = 'From: ' . $email . "rn" ;
$message = wordwrap ( $_POST [ 'message' ], 65 );
//send the email
$mail = mail ( $site_email , $subject , $message , $headers );
if( $mail == true )
{
echo "Mail Successful!" ;
}
else
{
echo "Mail Failed" ;
}
}
else
{
echo "Please fill in all the fields" ;
}
?>

Everything above its pretty self explanitory. The function wordwrap(); simply count the letters, and if it gets above 65, then a new line will be started.
The headers that were added to the mail() function, then add the different headers to the email. This can include things like Bcc, Cc and Reply to addresses.

In the above email, it will strap the from header as the email address that was provided on the forum.

Then the conditional checks to see if the mail was successful when the mail was attempted to be sent.

This script is an easy way to set up a quick and easy method to let your users send you some feeback. Copy and Paste =D


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
PHP Contact Form Tutorial

View Tutorial:
PHP Contact Form Tutorial

Related Tutorials:

Displaying 1 - 50 of about 2449 Related Tutorials.

PHP : Form to Email
PHP Form to Email PHP : Form to Email  ...; With the help of this tutorial you can send mails to a user using a form, as we have discussed in our earlier tutorial, it is very easy to send mails using PHP
 
PHP MySQL on Centos 5.x
support into your php application. In this tutorial I will show you how you.... Hope this tutorial will help you in installing MySQL support in PHP... PHP MySQL on Centos 5.x, PHP MySQL Centos PHP
 
Open Source PHP
for PHP scripts The main purpose of this tutorial is to kick off the new... and throughout the net regarding PHP. This tutorial will be fairly short, so even... Open Source PHP,Open Source PHP Shopping Cart,Open Source PHP & MySQL
 
PHP Getting Started With PHP Tutorial
with this quick and simple tutorial. Designed for the very beginners. What is PHP...://roseindia.net/tutorial/php/phpbasics/tutorial/index.html or http://roseindia.net/tutorial/php/phpbasics/index.html      
 
PHP PHP Triad Tutorial
PHP-Triad Tutorial PHP-Triad Tutorial  ...; In this PHPTriad tutorial we will learn how to download install and test an application on the PHPTriad server. PHPTriad is a software package which installs PHP
 
PHP File Manipulation Writing to a File Tutorial
database (text document) using this tutorial.  In PHP, we can do many...://roseindia.net/tutorial/php/phpbasics/tutorial/PHP-File-Handling.html  ... File Manipulation in PHP File Manipulation in PHP
 
PHP Working with Variables Tutorial
PHP working with variables PHP  variables...;  If you are planning to start writing in PHP you should  know... are not the same. In PHP it is not required to declare any variable before we use
 
PHP SQL Sanitize
Understand with Example The Tutorial illustrate an example from 'PHP SQL Sanitize... PHP SQL Sanitize PHP SQL Sanitize...; PHP SQL Sanitize is a kind of filter which is used to allow or disallow characters
 
PHP XML and PHP Backends Sharing Data Tutorial
PHP XML and PHP Backends Sharing Data Tutorial PHP XML and PHP Backends Sharing Data Tutorial      ...;        PHP XML and PHP Backends
 
PHP SQL Injection
The Tutorial illustrate an example from PHP SQL Injection. To grasp the example we... PHP SQL Injection PHP SQL Injection...; PHP SQL Injection is an interface that facilitate access  and interaction
 
PHP SQL Injection Example
PHP SQL Injection Example PHP SQL Injection Example...;  PHP SQL  Injection Example is used to show you how to insert the records to database. Understand with Example The Tutorial helps you
 
PHP SQL Injection Attack
with Example The Tutorial illustrate an example from PHP SQL Injection Attack... PHP SQL Injection Attack PHP SQL Injection Attack...;  PHP SQL Injection Attack refers to the act of  someone
 
PHP Ajax Book
PHP Ajax Book PHP Ajax Book  ...; AJAX and PHP:  Building Responsive Web Applications is the most practical... knowledge of PHP, XML, JavaScript and MySQL, this book will help you understand
 
PHP Displaying the date and time in your timezone Tutorial
PHP Date Time Zone PHP Date Time Zone...; In PHP Date Time Zone class displays the time of different time zone, along... (if any) of the country. Example: <?php //To instantiate an object $time
 
PHP Make a shoutbox without using MYSQL Tutorial
PHP Create a Shoutbox using MySQL PHP Create... database. Now to make your very own PHP shoutbox, which , first of all we need to create a .html file which has a form for accepting user name and message
 
PHP Sorting Arrays Tutorial
PHP Sorting Arrays PHP Sorting Arrays... will learn how to sort an array using key as well as value. Sort By Value: PHP.... There are so many functions are available in PHP, some of these are discussed below: i
 
SQL PHP Where
sql php where SQL PHP Where  ... PHP Where is used to built the connection between the SQL and PHP. The PHP sever side script is used to retrieve the records that meet a specific
 
PHP SQL close connection
PHP SQL close connection is used to close a connection between the PHP and SQL. Understand with Example The Tutorial illustrate an example... php sql close connection PHP SQL close connection
 
PHP Tutorials from RoseIndia
of PHP with this quick and simple tutorial. Designed for the very beginners... RoseIndia PHP, PHP Tutorials from Rose India a:link { color : #00a...; } PHP Tutorials from RoseIndia The detailed PHP tutorials for beginners
 
PHP Display date and time
: http://www.roseindia.net/tutorial/php/phpdate/index.html   ... PHP displaying the time and date into your timezone PHP displaying the time and date into your timezone   
 
PHP SQL Script
The Tutorial illustrate an example from 'PHP SQL Script'. To make use of sql... PHP SQL Script PHP SQL Script  ...;            PHP
 
SQL PHP
The Tutorial illustrate an example from 'SQL PHP'. To understand and elaborate... SQL PHP SQL PHP    ...;          SQL PHP is used
 
sql php array
sql php array sql php array  ...;            SQL PHP Array support simple dimension array. The SQL PHP Array is used to populate
 
PHP Mysql Group By
PHP Mysql Group By PHP Mysql Group...; PHP Mysql Group By is used to establish a relation between the PHP on the server side and Mysql database on the backend. Understand with Example The Tutorial
 
PHP SQL Connection
PHP SQL Connection PHP SQL Connection...; PHP SQL Connection is used to access and return the records from PHP and MySQL database and vice-versa. Understand with Example The Tutorial illustrate
 
MySQL PHP Insert
with Example The Tutorial illustrate an example on MySQL PHP Insert that create a table... MySQL PHP Insert MySQL PHP Insert...; Mysql PHP Insert is used to execute the Mysql function ( ) insert queries
 
PHP Mysql Database Connection
with Example The Tutorial illustrate an example from PHP Mysql Database Connection... PHP Mysql Database Connection PHP Mysql Database...;    PHP Mysql Database Connection is used to build
 
PHP SQL Example
PHP SQL Example PHP SQL Example  ...;            A PHP... is sent to the browser.  Understand with Example The Tutorial illustrate
 
PHP SQL Random
; Understand with Example The Tutorial illustrate an example from PHP SQL Random... PHP SQL Random PHP SQL Random  ...; The PHP SQL Random is used to fetch data randomly from database in PHP. The Rand
 
HTML Post Form
Form. In this Tutorial, the code explain you a post method in HTML. For this we... HTML Post Form HTML Post Form    
 
J2ME Tutorial
J2me Tutorial J2ME Tutorial  ... application. In this example we are creating a form name "Hello World"... Example This example illustrates how to insert text field in your form. We
 
J2ME Tutorial
J2me Tutorial J2ME Tutorial  ... application. In this example we are creating a form name "Hello World"... Example This example illustrates how to insert text field in your form. We
 
Mysql PHP Select
with Example The Tutorial illustrate an example from 'Mysql PHP Select'. To understand... Mysql PHP Select Mysql PHP Select...; Mysql PHP is used to execute the select statement using mysql_query ( ) function
 
Login Form
Login Form,Struts Login Form Login Form...; Login form in struts: Whenever you goes to access data... of this. In this section of struts tutorial we will explain how to do coding
 
Form and its Elements
Form and its Elements Form and its Elements... they are used in HTML. You will learn about the basic tags of a HTML Form
 
Ext Js form example.
Ext Js  form example.   ...; In this simplified application and easy to learn Ext Js Tutorial I will show you how to develop a form in Ext Js framework. The Ext Js form will take the input from user
 
sql php code
The Tutorial illustrate an example from 'SQL PHP'. To understand and elaborate... sql php code sql php code   ...;            SQL PHP
 
PHP SQL Select Where
PHP SQL Select Where PHP SQL Select Where...; PHP SQL Select Where is used to provide the records from the table... query. Understand with Example This section of Tutorial illustrate an example
 
MySQL Tutorial - SQL Tutorials
MySQL Tutorial,Free MySQL Tutorials,MySQL Programming Tutorials,Online MySQL Help for Beginners MySQL Tutorial - SQL Tutorials...;  Complete MySQL 5 Tutorial In this section you
 
PHP SQL Die
PHP SQL Die PHP SQL Die   ...;            PHP SQL Die... and exists from the current script. Understand with Example The Tutorial
 
MySQL PHP Query delete
with Example The Tutorial grasp you an illustrative example on 'MySQL PHP Query... MySQL PHP Query delete MySQL PHP Query delete...; Mysql PHP Query delete is used to execute Mysql function ( ) delete
 
PHP Generate a pages loading time Tutorial
PHP Page Loading Time PHP Page Loading Time             ... the initial time and final time, and everything will be sorted. Examples 1: <?php
 
J2EE Tutorial - Introduction
J2EE Tutorial - Introduction J2EE Tutorial... want to know whether J2EE is Java atall or something else. This tutorial... long journey and this 'short' tutorial cannot cover   all
 
J2EE Tutorial - RMI Example
J2EE Tutorial - RMI Example J2EE Tutorial - RMI... a continuously touring businessman who informs his current contact number to the enquiry desk and if we want to contact him, we have to get his
 
JSF Form Validation
JSF Form Validation,JSF Validation JSF Form...;   Complete Java Server Faces (JSF) Tutorial... to know about JSF. In this section on "JSF Form Validation" you
 
PHP Cookies and Sessions Flood protection using cookies Tutorial
PHP Flood Protection using session PHP Flood...;      In the following tutorial we will learn how... this, we have to use session, a valuable part of php Example 1: <?php
 
Ajax Tutorials
Ajax Tutorials,Java Ajax Tutorial,Online Ajax Tutorials,Free Ajax Information... connection with PHP/AJAX The purpose of this article is to demonstrate how the XMLHttpRequest object works within php and the advantages of using
 
VoIP Jobs
complete the submission form to provide a link to your job opportunity or contact
 
Beginners Java Tutorial
java Beginner,java Beginners,Beginning java,Beginners Java Tutorial,Java for beginners Beginners Java Tutorial...; This tutorial will introduce you with the Java Programming
 
Welcome to the Apache Struts Tutorial
- Jakarta Struts Tutorial Struts1 Examples Struts 2 Training! Get... in this tutorial. Struts1 vs Struts2 Struts2 is more powerful... to create user interface form using struts ActionFrom class and jsp page
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.