Question:
PHP and HTML Contact Email Form?
aleister_cooper
2009-03-14 09:55:57 UTC
Im looking for a PHP contact form that can display a thank you page when the message has been sent. I also want a error page when the message has been sent but none of the text fields have been filled out.
Eight answers:
ryan n
2009-03-15 20:40:38 UTC
You can post the form back to the same php page. On page load, check to see if the form was submitted, or if the page was just loaded.



if just initially loading, show the form.



If submitted check to make sure all the required fields are present in the GET, POST, or REQUEST params. Validate them that they contain good data. (Javascript is cool for validation without reloading the page, but if they have javascript turned off, then no validation is done.)



If everything looks good call you mail function and send the email. Or record the form data to a db, and later send them all out in a batch. And echo out your Thank you message.



If the data didn't validate, show the form again and echo out your error message.
anonymous
2009-03-14 10:06:37 UTC
To get the error message you use Javascript. Check the HTML form before submitting it. If there's a missing or incorrect entry (at least check email addresses and phone numbers for sanity) use an alert, and return false.



To get the thank you, or an error if there was a problem, the php mail() function returns true or false. Just fill in the argument list and, assuming your site has access to the server's SMTP server, the mail will get sent - or not, if there are errors like a bad address.



Using AJAX, you can have your HTML page send the information to the PHP page and get the result back without even refreshing the page.
anonymous
2009-03-15 07:10:28 UTC
Create a Contact Email Form from freedback.com. It provides step by step instruction to create the Contact Email Form . You will get a code, just copy and paste it. The site also provides an error page.
anonymous
2009-03-17 10:30:57 UTC
Here is a little comment system I put together.

This is not a "shout out" type system. I will add support for that in another version.

This system is meant for you to collect comments from users about your site. You can enable email too.

If you would like this BETA version just email support@dzsoundnirvana.com

or download it below.

Instillation notes are are the bottom of this page.



This script is provided with out any warranty. Read the Terms of Service at viewtopic.php?f=16&t=17



**Note**

This is BETA. I still have to add some more modules to it.



:arrow: Future modules:



Management portion for Admin defined subjects

Shout box capabilities

Admin defined email formatting (customization)

Reply/Reply All communication through the site via "View as email"





Below is a quick video of the system. You can play around with it at http://dzsoundnirvana.com/comment_system/



http://video.dzsoundnirvana.com/Dz_Comm ... hrough.swf

Here are some more features for the comment system.



http://video.dzsoundnirvana.com/Dz_Comm ... e_Features

:!: Instillation Notes:



Make sue you can FTP to a server with PHP and MYSQL running

Make sure you are able to use the mail() function (If you do not then you can set the send to mail configuration option to "N")

Edit the "config.inc.php" for your database settings.

The current SQL import is set for a database with a name of "comment_system" (You can create a new database with that name or you can edit the "comment_system.sql" file in the "bdback" folder) Make sure you do not upload this folder or file to your server



:!:



If you need assistance please email support@dzsoundnirvana.com
Schitzo
2009-03-14 10:02:12 UTC
I'm not sure if they have those exact things posted online.



If you want me to write one customized for you, I can for a small fee :P



Email me --> FlySkyHigh22@gmail.com
parse error
2009-03-14 12:35:37 UTC
Here you can make one:



http://phpcode.hu/mail_generator/



Just design how many fields you need.



if you specify which field names you have , i can help you to generate one.
?
2016-05-28 13:46:28 UTC
You must Process all Request as Values. In your Form ------------------------- And for the first one And at the top of your webpage in contact.php have this script to recieve each value-----if(isset($_POST['name'], $_POST['yes'], $_POST['no'], --and so on--)) Assign variables to each request JUST AFTER THIS->{ $name = $_POST['name']; Mail Script here then end } Else { ECHO "Could not send mail ! " } ?>
Baw
2014-02-09 10:11:58 UTC
http://fantasticemailform.com/ has "thank you" and "error page"


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...