It does not work
Ok, let's check to see if someone already filled the form out, if they did a hidden field called "Process" will have a value of one and the form will begin to process.
<CFIF IsDefined("process")>
If the process
field has a value of One, then do the following:
<!--- Send the message to
yourself, when the user posts it on your site. --->
<CFMAIL
to="webmaster@yoursite.com" from="#ContactEmail#"
Subject="Contact From YourSite.Com">
#ContactMessage#
Message By: #ContactName# - #ContactEmail#
========================================
</CFMAIL>
<!--- Send one to the
person writing, thanking them and reminding them what they wrote. --->
<CFMAIL
to="#ContactEmail#" from="From Email" Subject="The
Subject!">
Thank you for your message,
We'll be in touch as soon as we can, we receive
hundred and thousands
of emails a day; so we might take a while, but we'll reply!
Thanks again for visiting our site,
Yourname - Webmaster
Webmaster@Yoursite.Com
You wrote:
#ContactMessage#
Message By: #ContactName# - #ContactEmail#
========================================
</CFMAIL>
Thanks for your message!
<!--- If "Process" is not defined, let's show the form: --->
<CFELSE>
<cfform action="contact.cfm"
method="post">
<input type="hidden"
name="Process"
Value="1">
<table align="center"
border="0"
width="100%">
<tr>
<td
width="40%"
valign="top"
align="right">Name:</td>
<td
width="60%"><cfinput
type="text"
name="ContactName"
size="20"
required="yes"
message="Please Enter Your Name!"></td>
</tr>
<tr>
<td width="40%"
valign="top"
align="right">Email:</td>
<td width="60%"><cfinput
type="text"
name="ContactEmail"
size="20"
required="yes"
message="Please Enter Your Email
Address!"></td>
</tr>
<tr>
<td width="40%"
valign="top"
align="right">Message:</td>
<td width="60%"><textarea
rows="4"
name="ContactMessage"
cols="20"></textarea></td>
</tr>
<tr>
<td width="40%"
valign="top"
align="right"></td>
<td width="60%"><input
type="submit"
value="Submit Contact Form"></td>
</tr>
</table>
</cfform>
</CFIF>
There you go, that's the contact page for ColdFusion. Simple huh?
It does not work
Go here http://tutorial108.easycfm.com/ and read Kelan's comment at the very bottom. Wrap your contact page with this to mke sure critical info (passwords/emails) isn't displayed on errors.
************Kelan's comment************
A better method is...
...to use
I was wondering how I can get this contact information on the form to go into my sql database? Thanks!
I have never explored cfml like I have done in your site. It really inspired me to learn more and more. Thanks for the site.
Hey this is not working at all..
qs
Dear sirs , i have tried this form , but when i was running it , it gaves errors , i want to ask whether we should save all this form in a name " contact.cfm " i have tried it and is not working . thank you
sorry I'm new to CF, just want to know what's inside "contact.cfm". Thanks and best regards. rex