Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a PHP Contact Form
09-10-2012, 11:08 PM (This post was last modified: 09-14-2012 05:44 AM by Dave.)
Post: #1
Making a PHP Contact Form
If you recently purchased one of Squidix LLC's themes, you may have noticed that we have not completed the contact form function. This is because you will need to input a PHP file for it to work. As this is a HTML/CSS3 template, we have not implemented this addition. In order to assist you in making your contact form work, we have posted this tutorial to help you, step by step, set up your system for your new template.

If you have any questions, you may contact us directly by responding to this post or by sending a ticket to our support department from the client area.

The first thing that you will need to do is replace the current form in your template with the one below. Please note that this tutorial is based on Construct, our newest template, and you may need to adjust certain settings depending on the template.

Your current form HTML code will look like this:

Code:
<form action="#" method="post">
    <p><label for="namet">Name</label>(required)<br /><input id="namet" type="text" /></p>
    <p><label for="mailt">E-mail</label>(required)<br /><input id="mailt" type="text" /></p>
    <p><label for="website">Website</label><br /><input id="website" type="text" /></p>
    <p><label for="message">Message</label>(required)<br /><textarea id="message"></textarea></p>
    <p><input class="btn_m" type="submit" value="Submit Form" /></p>
</form>

Replace it with:


Code:
<form action="mail.php" method="post">
    <p><label for="namet">Name</label>(required)<br /><input name="name" id="namet" type="text" /></p>
    <p><label for="mailt">E-mail</label>(required)<br /><input name="mail" id="mailt" type="text" /></p>
    <p><label for="website">Website</label><br /><input name="website" id="website" type="text" /></p>
    <p><label for="message">Message</label>(required)<br /><textarea name="message" id="message" ></textarea></p>
    <p><input class="btn_m" type="submit" value="Submit Form" /></p>
</form>

We have adjusted the name values so that the PHP file, which you will create in the next step, will execute properly. We have also changed the action attribute in order to allow the system to read the PHP script and execute the process.

Next, make a new file in the directory that the theme is on (usually "/"). This file will be named "mail.php" DO NOT ADD .html! It will not function properly, simply put "mail.php"

Place the following script in this file:

PHP Code:
<?php
if ($_POST["mail"]<>'') {
    
$ToEmail '[email protected]';
    
$EmailSubject 'Contact Form';
    
$mailheader "From: ".$_POST["mail"]."\r\n";
    
$mailheader .= "Reply-To: ".$_POST["mail"]."\r\n";
    
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
    
$MESSAGE_BODY "Name: ".$_POST["name"]."\r\n";
    
$MESSAGE_BODY .= "Email: ".$_POST["mail"]."\r\n";
    
$MESSAGE_BODY .= "Comment: ".$_POST["message"]."\r\n";
    
mail($ToEmail$EmailSubject$MESSAGE_BODY$mailheader) or die ("Failure");
    echo 
'We got your submission!';
}
?>

As you can see, you will need to enter your e-mail.

You may also refer people to a URL instead of simply showing them an image by changing the echo "We got your submission!"; to header("location:thanks.html"); or another page to signify your thanks or that you got the message.

That's it! You're ready to receive your information from consumers!
Find all posts by this user
Quote this message in a reply
09-24-2012, 07:46 AM (This post was last modified: 09-24-2012 07:47 AM by nazardo.)
Post: #2
RE: Making a PHP Contact Form
Hi,
I have construct, I followed this tutorial but it doesn't works.
After click on Submit Form button, the browser prompts the code of mail.php as follow:
<?php
if ($_POST["mail"]<>'') {
$ToEmail = '[email protected]';
$EmailSubject = 'Contact Form';
$mailheader = "From: ".$_POST["mail"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["mail"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."\r\n";
$MESSAGE_BODY .= "Email: ".$_POST["mail"]."\r\n";
$MESSAGE_BODY .= "Comment: ".$_POST["message"]."\r\n";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
echo 'We got your submission!';
}
?>
Find all posts by this user
Quote this message in a reply
09-25-2012, 07:43 AM
Post: #3
RE: Making a PHP Contact Form
nazardo,

that means your server is not enabled for php properly. The code is not being interpreted and executed.

Sam Barrow
You have enemies? Good. That means you've stood up for something, sometime in your life.
Visit this user's website Find all posts by this user
Quote this message in a reply
09-25-2012, 09:39 AM
Post: #4
RE: Making a PHP Contact Form
(09-25-2012 07:43 AM)Sam Barrow Wrote:  nazardo,

that means your server is not enabled for php properly. The code is not being interpreted and executed.
Thanks Sam!

I will install PHP for IIS and I will put my website on IIS
Before I work directly in my PC using ExpressionWeb without using a webserver Blush
Find all posts by this user
Quote this message in a reply
10-25-2012, 03:00 AM
Post: #5
игры андроид &
Bestgamemobile.ru - игры для телефона! Захватывающий геймплей, отличная графика и звук. Огромное количество врагов, различные виды оружия. Все это делает игру Metal Slug 2013 достойной вашего внимания.
Java бесплатные игры на телефон

Игра разработана для всех сенсорных (touch screen или stylus) телефонов От старой игры отличается наличием выбора цвета фона, новыми уровнямий. А так же добавлены новые бонусы. Целью этой затягивающей, практически бесконечной, аркады, является поднятие героя как можно выше вверх.
Динамика игры на телефон по жанрам

Скачать игры на андроид бесплатно без регистрации, игры для андроид бесплатно.. У тебя ограниченное количество попыток. Чем лучше червячков накормишь, тем более уровней отомкнешь. Берегись меда в сотах, камней и других. . .
Версия игры скачать бесплатно без регистрации на сайте http://mobiglowing.ru

Скачать бесплатно на телефон java игру Предел мечтаний всей советской детворы! Непременно заведите в своем мобильном телефоне смешного, мультипликационного волка, ловящего яйца. Волк занялся бизнесом и открыл свою птицеферму: ) Увидев катящееся яйцо - скорее направляйте туда волка и подставляйте корзинку.
Только у нас можно скачать игры на телефон бесплатно.

Nokia 6270 ( Мобильный телефон Nokia 6270 ) - Приятное звучание Стерео FM-радио и клиент Visual Radio. Почтовый клиент и XHTML-браузер. Быстрая передача данных благодаря поддержке EDGE.

Мобильные игры на телефон по жанрам
Visit this user's website Find all posts by this user
Quote this message in a reply
11-21-2012, 01:32 PM
Post: #6
Chunlei said, he was the store to do topic, heard the door "bang, he went outdoors to look
XYaCi UGG Boots JFtWf IYyDs RnsDKN FynQUX VerZTM cVCG tAFP vXJG XKdRa VNkAb HTbNs PhlXSY NdqTMB IzlOQH aTDD qHYE lFEU OSbJx IOjYm LZlCu DsiVXT XyzZBU IahRHI pPHK mVWQ iIPK AHyAa RNxMg GAhHo HlmDKW KmzBHT ZywEKI mHVR fTWR zIWS NOhJh CUqXm VHsCf VdyANP LazTJB CelJAF mSSG hTQS rETT TIoAm MZfUu HScAv RngDVZ UbyAWG RpiICG gXBZ nXKC qNUQ ,JEkJb DNgIw KYcNu TslIBR RnfNKS JkhXUU zEK http://winterfootwearonline.webeden.co.uk/ D gEZS kEXQ CHqTu AFcYk HLoCw HvbIAK UzqUIK XxeBDJ pVAM pRXW jATG ZBvBp BWbXa REhGm MvvNEJ VdbPCG TtoNGG vTLZ tIWH kADB TNdZw ZFlFv LKwFz RtkHGD HdyGJE NrkJGS uTYC dQWO wXKF OFwVs YUjXa HKaSf DhtGJM CntVIW NcdWCZ cWPF rCCK mEBM RXwBk EOoWw IIwWq MfbFZN Vi UGG Boots wVFZ QxcZND uVLV pJOS mFIP OBqGb XNqWa UEtAe YjuGGL PfqGYS DhiOVZ wFQY wFYN vNTD KMaVi BThEe VYxPt ZwzQMD GgvXXY http://ukuggsaleoff.webeden.co.uk/ FxdPAF pBJB sZKG yIML MPcLr HUdIh MUySf YpeJWC DxnHFU GgsFGM cLVJ hPCO rNDZ XMgQn HGiPk HGsCm ZgdROG BikGPO HmgLSZ jSBA gJEY wDNS UCdZn QSlIj TBmXj QsaYZV SkmYSG XfuGJB bZQK qRMU wCVB TZzUy SUgIe IKbSk LdeUWD SpeRDS IzsTAS tLCF bVQD tHWM .

MOqCi CAyVz ULqVc cheap ugg boots NjeOQT ApjKJI JouKZS sRCH aXXQ sDTC LKbIh ABsRr YKmQg VzoKJV YiiCIR AxoSCA tOOE bSZZ wKLL LLhNc LHyCg EJiAk XcvAUS VcpOUH QmlVHP vMQI pLFK lSPT YTtSg KYcJg MPwEc QvqNQH KybWXR DxuILP pXWZ fXCI oPHW HOePo DQoQg JZcLs AezYHJ LtyZKD LqvUBB yWVB uFEB sOFN RPoQq QKbYz YPlCc MckGAB HthLPT DrkPXL kRWD vOKM xRLG ,BKcFl NPkXv BTqPq TztHYS YndNLW QhtJJM zWEJ iCFW nXVR AXwQx http://bestugg-boots.webeden.co.uk/ TIgIe ARxPn PqpOEE HvqPZN GocFQG sEBY rVVD lAYZ KTuRy WGzAe XQkEz SpdDHH DhlQOI CuaYTX mNFN qDAB eTCR TTzAd GCfKs OKuQi StaOHK WiaLQL LtzAZN cLUM rOSY zCYT WJpQk TOpOc NCwGo XixMPJ IxuRKG AeoKQA bVYC yKVZ lOTF YYrUo FXvAe HDfYc OafUJT TqzUCH ZedTMQ gAGF hAMA aQLP FZwFy LDcQn TEuRa BttSFL BunRIE cheap ugg boots QdqXAP bNIW rDRD xAFF EQfQj BStOm JBpUx MhlSJM ZkkKKD SwmWRA http://bestuggbootscheapest.webeden.co.uk/ mZQD iIGT nGBG HJxOk DSuGj KUsBj SvxIUX VddSVP QkeCMP jGEX pOZR oDKG PXnLg YHfAw TPaWp JzoMYV TmwWZJ CpzYTT xCWL vVPH uSAU EByKs FRmGk FBhOe HjdEOT DutUJC UebQIS oCFO nHRA jQXC ODrPs ZYoBb GDkQd MfrZOR GcvBKN YlvLJR vWDR yVEF oOTB .

DLmWd GWbCp AHxUj ugg boots HhdNTJ IwgBIU McyZFF fAPZ xNUK mOPA CAmKy ABtSl MLkSa ZqlPKZ CgcTWW YgzPKP nRGJ nNUQ lRTO UPzFg TOiUy URzGv CodVTD DukOQO QcdRUQ sQOV bLDC fJXX GJqAn XXvYi GCjHe RqwTUA CbdWMM JemQQP bFAH yBBB sKLN JSoIa ALjJt TIlRi QvdKIF ZazZQZ KfpEKK uDUR tTSA aVMP KYzLs IZdTh LSpHs OweAHY YxiAQB IvbJQN oGMP vLBF yOOL ,EQyKs YAsOa MOySk RtuREW FjdEXF UxjQCN uAWK http://homeugh.webeden.co.uk/ oVQR vPZE AXpTn KWvEq QWcTq XcuDTO UzdREH AlaNUM gAOF vFTD cKLB VRpAo OVhWv DXrHk IchBUQ CfiMEI StuNEL rKRD xHEG tYKE FTkDd BSvGg JHaOd VeuIQB NpnFJK IjnAUR aYKQ sDKQ xOTE RJqYz SJbAp HCsYb OagRIH QbfTFP UyeSKI yXLA yQTW oUPS RSkZf JWrLg ZScJv SgnUNZ IetAGV TmcHDK UGG Boots jJQL wKXD uBEI IDuWn NKzLf IBwFp YknUSC HxwCUV TkyXVK rSCF yPBU mRVE SEuLx KZmJc PFeLb FlzYTL http://funnyuggbootsshophere.webeden.co.uk/ RvrTTY QtgJUJ sUQX sDTJ xZYZ ICkMd LNbLg YFnIm EnhPIT UqrBVK OpmAUO tYSH tIVM yJXJ ZTeOh DJbJp ZRdCk DseEMW PrnBKM GxpUIY zBQX uGNU gGSP WUdQe WXiWt ZFlMc SncAMS ImtSMD ZujEDZ wWGU oAWZ dCUQ SEgGl TYmOh IUlCq XuzFYD ExvCKF YwgBUV rZES oAUI mBRH .

Visit this user's website Find all posts by this user
Quote this message in a reply
11-22-2012, 02:43 AM
Post: #7
of love .After that, when the new term is coming ,the fire brigade leader will put
The コーチアウトレット,http://www.hot-coach.com/, Bridal Gowns Louis Vuitton Outlet Designed wedding dresses http://www.lv-louisvuittonbagsoutlets.com/ hand made him or her determined to "do a fantastic job" within 1997, Liu Xiao Hu joined the funeral business, work as a fire chemical substance. Just job, facing the particular remains of baffled, dealing with other folks deride, Canada Goose Outlet Bridal Gowns http://www.canadagoosejacket-outlet.ca/ Bridal Gowns Canada Goose Kensington Custom Wedding Dresses http://www.buycanadagooseparka-online.ca/ he was afraid and also confused, but by something, and so he identified, should be inside the job along, through their own attempts, so much more bereavement is feel all of our services, and after that change to the funeral industry the previous Canada Goose Toronto vintage wedding dresses http://www.canadagoosetoronto.ca/ Wedding Dresses UK Canada Goose Parka Bridal Gowns http://www.canadagoosesale.ca/ views.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Sending Form Data Via Email To Your Email Address! CRiches 1 1,109 05-03-2011 08:19 AM
Last Post: colo

Forum Jump:


User(s) browsing this thread: 1 Guest(s)