It appears you have not yet registered with our community. To register please click here...


Email Form

This is a discussion on Email Form within the Coding Tutorials forums. Topic: Welcome, today you will learn how to create you're first very basic email form and handler. First lets make ...


Reply
 
Postbit Seperator LinkBack Thread Tools Postbit Seperator Display Modes
Old 12-10-2006, 12:39 PM   #1 (permalink)
 
Status: Junior Member
Join Date: Dec 2006
Posts: 25
Trader Rating: (0)
Retire at 21 is on a distinguished road
TD$: 0.00
Donate
Default Email Form
Welcome, today you will learn how to create you're first very basic email form and handler.

First lets make the form, if you dont know how to create a form, look back on the form tutorial.

Code:
<form method=post>
Name<br/>
<input type=text name=name /><br/>
Query<br/>
<textarea name=query></textarea><br/>
<input type=submit name=submit value='Submit' />
</form>
Now that we have got the form completed we can start on our handler.

Code:
<?
if(isset($_POST['submit'])){//If the form was submitted
//do this
}
else{ //the form hasent been submitted so we show the form
echo '<form method=post>
Name<br/>
<input type=text name=name /><br/>
Query<br/>
<textarea name=query></textarea><br/>
<input type=submit name=submit value='Submit' />
</form>'; //end the echo
} //end the else
?>
Thats the first basic thing done.
We have checked to see if the form was submitted and if it wasent it shows the form.
Now for the next piece.

Code:
<?
if(isset($_POST['submit'])){//If the form was submitted
$name = $_POST['name']; //get the name
$query = $_POST['query']; //get the query
$output = '
Name: $name
Query: $query';
$mail = mail('youremail@yourdomain.com','subject',$output); //mail it
echo 'You're email has been sent! congrats, you've completed you're first email form.';
}
else{ //the form hasent been submitted so we show the form
echo '<form method=post>
Name<br/>
<input type=text name=name /><br/>
Query<br/>
<textarea name=query></textarea><br/>
<input type=submit name=submit value='Submit' />
</form>'; //end the echo
} //end the else
?>
Congrats, you've made you're first email form handler.

Register @ Retire at 21 If you like this tutorial
Retire at 21 is offline   Reply With Quote
Old 11-13-2008, 06:05 AM   #2 (permalink)
 
Status: Member
Join Date: Oct 2008
Posts: 39
Trader Rating: (0)
antoniyo is on a distinguished road
TD$: 245.00
Donate
Default Re: Email Form
I ever read on the forums that someone need to know or some want to make email form,but i couldn't help them, Actually i am not a programmer but i believe that i can help someone bu surfing on the net.as i got this thread and will going to tell someone who really need it.
antoniyo is offline   Reply With Quote
Old 12-09-2008, 05:46 AM   #3 (permalink)
 
Status: Junior Member
Join Date: Dec 2008
Posts: 1
Trader Rating: (0)
Maroaccurry is on a distinguished road
TD$: 15.00
Donate
Default miniature christmas tree skirt free pattern
http://anymore.hostevo.com/christmas7bc.html <a href=http://anymore.hostevo.com/christmas7bc.html>christmas church angles</a> christmas church angles
__________________
office christmas themes
Maroaccurry is offline   Reply With Quote
Table Bottom LeftTable BottomTable Bottom Right
Reply


Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a form - PHP - SQL Retire at 21 Coding Tutorials 2 11-10-2008 08:59 AM
Form Processor Kleopatra PHP & MySQL 1 07-23-2007 02:15 AM
Simple Email Validation Demonslay Coding Tutorials 3 03-21-2007 09:49 AM
Form Processor Elton333 HTML & CSS 0 02-22-2007 05:25 PM


Home | Site Map | Contact | Archive | Top

 

Copyright © 2007 - 2010 iTalkWebs Network

Search Engine Optimization by vBSEO 3.1.0