Frequently Asked Questions

|
How can I create a simple contact form? |
- Create a form with as many as fields you want, name it "contact.php"
- Create a "thank you" page, name it "thanks.php"
- In "action" line of contact.php post it to your "thank you" page, it will be something like this:
<form action='thanks.php' method='POST'> - Add this code at the top of your "thank you" page:
<?php
$ToAddress = "PUT_YOUR_EMAIL_ADDRESS_HERE";
// To send it to more than one reception use
// coma (,) between addresses.
$message = "Message from web form\n";
$message .= "-------------------------------------------\n";
foreach ($_POST as $key => $value){$message .= "$key: $value\n";}
$message .= "-------------------------------------------\n";
mail("$ToAddress",
"Message from web",
"\r\n".$message,
"From: $ToAddress\r\nCc:\r\nBcc:\r\n\r\n");
?>
- Make change to first line of the code with your email address. For example:
$ToAddress = "PUT_YOUR_EMAIL_ADDRESS_HERE"; to $ToAddress = "lisa@dayanahost.com";
- Now upload both pages to public_html folder of your account.
- That's it and you are ready to go.
Note: You may change the name of these pages, Just make sure that action line of the contact form addressed to "thank you" page.
|
More than 100,433 web sites hosted.Latest client joined at May 16, 2012, 9:58am PDT