Best Web Hosting with 100% Satisfaction Guarantee by Dayana Host

Frequently Asked Questions

Category:
How can I create a simple contact form?

  1. Create a form with as many as fields you want, name it "contact.php"
  2. Create a "thank you" page, name it "thanks.php"
  3. 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'>


  4. 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");

    ?>

  5. 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";

  6. Now upload both pages to public_html folder of your account.
  7. 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. 

Dayana Host
Home Process Guide Affiliate Program Testimonials Sample Clients Control Panel Demo AUP / ASP / TOS Privacy Policy
Product and Services
Domain Registration Say5 Web Hosting Personal Web Hosting Business Web Hosting Reseller Web Hosting Unlimited Web Hosting Traffic Blazer Web Design Themes Members Area
Network Tools
Network Maps Network Status NS Lookup Whois Search IP Location Free SEO Tools
Customer Support
Customer Service Contact Support Center CPanel Tutorials FAQ Getting Started Guide Useful Links Downloads
Other Services
phpOnline LiveAdmin Free Counter