|
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">Replace it with: Code: <form action="mail.php" method="post">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: <?phpAs 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! |
|||
|
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 = 'xxx@yyy.com'; $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!'; } ?> |
|||
|
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. |
|||
|
09-25-2012, 09:39 AM
Post: #4
|
|||
|
|||
RE: Making a PHP Contact Form
(09-25-2012 07:43 AM)Sam Barrow Wrote: nazardo,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
|
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Sending Form Data Via Email To Your Email Address! | CRiches | 1 | 1,219 |
05-03-2011 08:19 AM Last Post: colo |
|
User(s) browsing this thread: 1 Guest(s)






















