Results 1 to 2 of 2

Thread: Contact form: how to make it works?

  1. #1
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Contact form: how to make it works?

    Hello everyone,

    http://playground.mobily.pl/assets/f...wesomeform.zip
    I find this contact form is very nice.
    But I don't know how to make it works.

    Because there is no php file.
    I don't know where to set the email address
    which users can submit to.

    Could anyone help me...?

    Thank you!!!

  2. #2
    Join Date
    Jun 2010
    Location
    South Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Shirley
    I looked at this form and here's a simple php page that should work.

    First the form needs to be directed to the php file with the full address of your site (I called it mailsent.php)

    Code:
    <form id="form" class="blocks" action="http://YOUR WEBSITE ADDRESS/mailsent.php" method="post">
    Now the code for the page "mailsent.php" is below:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <h1>Email Result</h1>
    <?php // get form data 
    $email=$_POST['email'];
    $name=$_POST['name'] . "-" .  $_POST['company'] . "-" . $_POST['phone'];
    $subject="YOUR SITE NAME - WEBSITE ENQUIRY"; // enter your website domain name here
    $message="SENDER:- " . $name . "  MESSAGE:-  " . $_POST['Comments'];
    $to = "ENTER YOUR EMAIL ADDRESS HERE"; // this is where your email address goes
    $headers = "From: $email"; 
    $sent = mail($to, $subject, $message, $headers) ; // sending email
    if($sent)  //successfully sent
    {
    ?> 
    <table width="500" border="0" align="center" cellpadding="1" cellspacing="0">
       <tr> 
          <td align="left" valign="top" bgcolor="#ccc"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                   <td align="center" bgcolor="#ccc"> <p>&nbsp;</p>
                     <p>Thankyou. Your Email Has Been Sent</p>
                            <p>Please <a href="ENTER REFERRAL PAGE HERE">click 
                              here </a> &nbsp;to continue</p>
                  <p>&nbsp;</p></td>
                </tr>
             </table></td>
       </tr>
    </table>
    <? } //end if
    else // unsuccessfully sent
    {
    	?> 
    <p>&nbsp;</p><table width="500" border="0" align="center" cellpadding="1" cellspacing="0">
       <tr> 
          <td align="left" valign="top" bgcolor="#ccc"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                   <td align="center" bgcolor="#ccc"> <p>&nbsp;</p>
                     <p>Sorry , An Error Was Encountered </p>
                            <p>Please <a href="ENTER REFERRAL PAGE HERE">click 
                                here</a>&nbsp;to continue</p>
                      <p>&nbsp;</p></td>
                </tr>
             </table></td>
       </tr>
    </table>
    <? } //end else
    ?>
    </body>
    </html>

    I hope this helps.
    Last edited by rickybacker60; 08-06-2012 at 06:16 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •