SlideShare a Scribd company logo
10/9/12 Creating simple PHP contact form
1/3www.phpeasystep.com/phptu/8.html
Home Tutorials Search
PHP Tutorials
All PHP Tutorials
Ad Management
Counter
Email System
Forum and
Guestbook
File Upload
Image Manipulation
Login / Members /
Password
Pagination
Encode Script
Refresh / Redirection
Miscellaneous
MySQL
All MySQL Tutorials
Create, Manage
Database using
phpMyAdmin
Connect to Database
Insert Data
Select Data
Update Database
Delete Database
Order Results
PHP Text Editors
Downloads
PHP, MySQL Books
Web Hosting
Creating simple PHP contact form
When you need user to send feedback to your email, you can use contact form. In this
tutorial you'll learn how to create contact form with php script.
Overview
if you want to test on you own computer you must set your computer as a mail server
by using Argosoft mail server other softwares that have the same features as Argosoft.
Read this tutorial for how to set up.
In this tutorial, create 2 files
1. contact.php
2. send_contact.php
Steps
1. Create file contact.php.
2. Create file send_contact.php.
STEP1: Create file contact.php
############### Code
<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>
10/9/12 Creating simple PHP contact form
2/3www.phpeasystep.com/phptu/8.html
<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>
STEP2: Create file send_contact.php
############### Code
<?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){
10/9/12 Creating simple PHP contact form
3/3www.phpeasystep.com/phptu/8.html
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>
Similar Post
PHP Script Image of the day
In this script shows you how to display image of the day. You can adapt
this script to display quote of the day, knowledge of the day or something
else you want. You don't have to change image everyday just change
images once a week.
Creating simple PHP contact form
When you need user send feedback to your email you can usecontact
form. In this tutorial you'll learn how to create contact form with php script.
© 2005 - 2012 PHPeasystep About Us Contact Us

More Related Content

PDF
Database connectivity in PHP
PDF
03 the htm_lforms
PPT
Chapter 07 php forms handling
PPTX
Html 5 Forms
PPT
04 Html Form Get Post Login System
PDF
Making web forms using php
PPTX
Html 5-tables-forms-frames (1)
PDF
HTML5 Forms - KISS time - Fronteers
Database connectivity in PHP
03 the htm_lforms
Chapter 07 php forms handling
Html 5 Forms
04 Html Form Get Post Login System
Making web forms using php
Html 5-tables-forms-frames (1)
HTML5 Forms - KISS time - Fronteers

What's hot (20)

PPTX
13. view data
PPTX
HTML frames and HTML forms
PPT
Ddpz2613 topic6 frame
PPT
PHP - Introduction to PHP Forms
PPTX
Form Handling using PHP
DOCX
Php forms and validations by naveen kumar veligeti
PPTX
PHP Form Validation Technique
PPT
Html frames
PPTX
HTML5 Web Forms
PPTX
Synapse india basic php development part 2
PDF
How to create Custom Page Template in WordPress
PDF
4.1 html lec 4
ODP
XPages Extension Library - Create an app in 1 hour (almost)
PPTX
Oscommerce Presentation
PDF
Odoo Basic Admin.
PPT
Lecture7 form processing by okello erick
PDF
Troubleshooting Email Like a Pro
PPTX
PHP Training Institute in Ambala ! Battra Computer Centre
PPTX
Kristina benjamin fonttag
PPTX
Javascript
13. view data
HTML frames and HTML forms
Ddpz2613 topic6 frame
PHP - Introduction to PHP Forms
Form Handling using PHP
Php forms and validations by naveen kumar veligeti
PHP Form Validation Technique
Html frames
HTML5 Web Forms
Synapse india basic php development part 2
How to create Custom Page Template in WordPress
4.1 html lec 4
XPages Extension Library - Create an app in 1 hour (almost)
Oscommerce Presentation
Odoo Basic Admin.
Lecture7 form processing by okello erick
Troubleshooting Email Like a Pro
PHP Training Institute in Ambala ! Battra Computer Centre
Kristina benjamin fonttag
Javascript
Ad

Viewers also liked (20)

PDF
Mazaira gonzález -2001
DOCX
PDF
Presentación corporativa NUGAR PMO 2014
PDF
PDF
On Track With On Demand Speaker Presentation Oug Conference
DOCX
Jorge andressanchezbetancur 10°b_08octubre2014_tercerperiodo
PPTX
Internet, clave del exito empresarial
PPTX
Grupo 102058 580
PPTX
25 cosas sobre mi
PPTX
AMEE presentation 2011 Junior Doctor engagement with elearning tool
PDF
Hosting Dergi - 9.SAYI
PDF
2° informe s. gabriel 2014
PDF
Pre Renovation Handbook
PDF
Lürzer Ferien
PPTX
Tipos de contenedores
PDF
Procesamiento de Julio De Vido y Ricardo Jaime
PDF
Resistencia al cambio. dirección estratégica.
PDF
Cuina casolana i festes populars - Banyeres de Mariola
PPTX
Tic Low Cost
PDF
Ingrid Klinge, Energy Valley - Pitch
Mazaira gonzález -2001
Presentación corporativa NUGAR PMO 2014
On Track With On Demand Speaker Presentation Oug Conference
Jorge andressanchezbetancur 10°b_08octubre2014_tercerperiodo
Internet, clave del exito empresarial
Grupo 102058 580
25 cosas sobre mi
AMEE presentation 2011 Junior Doctor engagement with elearning tool
Hosting Dergi - 9.SAYI
2° informe s. gabriel 2014
Pre Renovation Handbook
Lürzer Ferien
Tipos de contenedores
Procesamiento de Julio De Vido y Ricardo Jaime
Resistencia al cambio. dirección estratégica.
Cuina casolana i festes populars - Banyeres de Mariola
Tic Low Cost
Ingrid Klinge, Energy Valley - Pitch
Ad

Similar to Creating simple php contact form (20)

PPTX
Sessionex1
PPTX
Section1 HTML (part2) Web technology for b
PDF
Practical PHP by example Jan Leth-Kjaer
PDF
PHP and MySQL : Server Side Scripting For Web Development
PDF
Web Development Course: PHP lecture 2
PPTX
SQL2.pptx from vu university short and long
PDF
The Django Book - Chapter 7 forms
PDF
User authentication module using php
PPT
Create Components in TomatoCMS
PPT
HyperTextMarkupLanguage.ppt
DOCX
RequirementsAddToMailList.txt ;echo Thank you for Jo.docx
PPTX
Html forms
PDF
Login and Registration form using oop in php
PPTX
Lesson 1
PPTX
Lect# 1 html part ii
DOCX
Tercer trabajo de drapi 02
PPTX
HTML - hypertext markup language
DOC
Ex[1].3 php db connectivity
PPT
Class 6 - PHP Web Programming
PDF
Practicals it
Sessionex1
Section1 HTML (part2) Web technology for b
Practical PHP by example Jan Leth-Kjaer
PHP and MySQL : Server Side Scripting For Web Development
Web Development Course: PHP lecture 2
SQL2.pptx from vu university short and long
The Django Book - Chapter 7 forms
User authentication module using php
Create Components in TomatoCMS
HyperTextMarkupLanguage.ppt
RequirementsAddToMailList.txt ;echo Thank you for Jo.docx
Html forms
Login and Registration form using oop in php
Lesson 1
Lect# 1 html part ii
Tercer trabajo de drapi 02
HTML - hypertext markup language
Ex[1].3 php db connectivity
Class 6 - PHP Web Programming
Practicals it

More from Daniel Downs (20)

PPT
Developing a mobile application curriculum which empowers authentic
PDF
Module11: Creating A External Style Sheet and Creating A Gallery
PDF
Seo continued page 2
PDF
Module 10search engine optimization
PDF
Ipad quick-reference-2
PDF
Index of jquery template 2 Minuteman Summer Web Dev.
PDF
Jquery template 1 3 pages
PDF
Module6 htmlcss helpfulcodeandwebsites
PDF
Module 4 Minuteman Lexington Web Design Daniel Downs
PDF
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
PDF
Module 2 lexington minuteman web development basic layout template
PDF
Module 1 Web design & Development Lexington Minuteman
PDF
App research project
PDF
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
PDF
Blogger custom domain on go daddy blogger widgets
PDF
Outline for action research prospectus
PDF
You have decided to go off on your own as a freelance webdesigner
PDF
Making a basicappinflash (1)
PDF
Daniel Downs Technology Portfolio Final May 2013 final (1)
PDF
Web design 1& 2 lesson outline
Developing a mobile application curriculum which empowers authentic
Module11: Creating A External Style Sheet and Creating A Gallery
Seo continued page 2
Module 10search engine optimization
Ipad quick-reference-2
Index of jquery template 2 Minuteman Summer Web Dev.
Jquery template 1 3 pages
Module6 htmlcss helpfulcodeandwebsites
Module 4 Minuteman Lexington Web Design Daniel Downs
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
Module 2 lexington minuteman web development basic layout template
Module 1 Web design & Development Lexington Minuteman
App research project
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
Blogger custom domain on go daddy blogger widgets
Outline for action research prospectus
You have decided to go off on your own as a freelance webdesigner
Making a basicappinflash (1)
Daniel Downs Technology Portfolio Final May 2013 final (1)
Web design 1& 2 lesson outline

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Machine Learning_overview_presentation.pptx
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
A comparative analysis of optical character recognition models for extracting...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25-Week II
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
The AUB Centre for AI in Media Proposal.docx
Dropbox Q2 2025 Financial Results & Investor Presentation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Machine Learning_overview_presentation.pptx

Creating simple php contact form

  • 1. 10/9/12 Creating simple PHP contact form 1/3www.phpeasystep.com/phptu/8.html Home Tutorials Search PHP Tutorials All PHP Tutorials Ad Management Counter Email System Forum and Guestbook File Upload Image Manipulation Login / Members / Password Pagination Encode Script Refresh / Redirection Miscellaneous MySQL All MySQL Tutorials Create, Manage Database using phpMyAdmin Connect to Database Insert Data Select Data Update Database Delete Database Order Results PHP Text Editors Downloads PHP, MySQL Books Web Hosting Creating simple PHP contact form When you need user to send feedback to your email, you can use contact form. In this tutorial you'll learn how to create contact form with php script. Overview if you want to test on you own computer you must set your computer as a mail server by using Argosoft mail server other softwares that have the same features as Argosoft. Read this tutorial for how to set up. In this tutorial, create 2 files 1. contact.php 2. send_contact.php Steps 1. Create file contact.php. 2. Create file send_contact.php. STEP1: Create file contact.php ############### Code <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>
  • 2. 10/9/12 Creating simple PHP contact form 2/3www.phpeasystep.com/phptu/8.html <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> STEP2: Create file send_contact.php ############### Code <?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){
  • 3. 10/9/12 Creating simple PHP contact form 3/3www.phpeasystep.com/phptu/8.html echo "We've recived your contact information"; } else { echo "ERROR"; } ?> Similar Post PHP Script Image of the day In this script shows you how to display image of the day. You can adapt this script to display quote of the day, knowledge of the day or something else you want. You don't have to change image everyday just change images once a week. Creating simple PHP contact form When you need user send feedback to your email you can usecontact form. In this tutorial you'll learn how to create contact form with php script. © 2005 - 2012 PHPeasystep About Us Contact Us