Contact form-checkbox PHP coding doesnt work

I am a beginner to web page design so i would be grateful if you can explain to me what PHP coding i would need for 'Checkbox' and where to place it in the PHP coding below. I can submit the form to my email with all the headings and the filled in forms with checkbox Yes or No.
Only problem i have is that part of the check box info appear right at the top of the email message rather than the 'Name', 'Tel', 'Email' etc..Another half of the checkbox appear where it suppose to be wih double heading as shown below. I would also like to remove the <br> from the email message. Can you also tell me how to change the colour for heading so its clear.
I have marked the checkbox code in BLUE for both HTML and PHP coding below. Sorry for the long coding. Look forward to hearing from someone. Much appreciated.
Message delivered to the email address as received:
Rear ground extension: Yes
Two-storey rear extension: Yes
Two-storey side extension: No
Loft: Yes
New Build: Yes
Other: Yes
Name: Test<br>
Email: [email protected]<br>
Contact No: 87576as<br>
Address1: addy1<br>
Address2: addy2<br>
Town: town<br>
County: county<br>
Postcode: post<br>
Property Type: Cottage<br>
Property Area: None<br>
Message:<br>
test msg
My HTML coding for the form:
<div class="contactForm">
      <form id="form1" name="form1" method="post" action="test2.php">
        <fieldset>
          <legend><strong>Personal Information</strong></legend>
          <table width="690" border="0">
            <tr>
              <td width="340"><p>
            <label for="name" class="contactLable">Name:</label>
            <input name="name" type="text" id="name" tabindex="10" size="30" />
          </p></td>
              <td width="340"><p>
            <label for="contact_number" class="contactLable">Contact No:</label>
            <input name="contact_number" type="text" id="contact_number" tabindex="20" size="30" />
          </p></td>
            </tr>
          </table>
          <table width="690" border="0">
            <tr>
              <td><p>
            <span id="sprytextfield1">
            <label for="email" class="contactLable">Email:</label>
            <input name="email" type="text" id="email" tabindex="30" size="30" />
          <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> </p></td>
            </tr>
          </table>
        </fieldset>
        <fieldset>
          <legend><strong>Project Information</strong></legend>
          <p><table width="690" border="0">
  <tr>
    <td width="340"><p>
            <label for="address1" class="contactLable">Address 1:</label>
            <input name="address1" type="text" id="address1" tabindex="40" size="30" />
          </p></td>
    <td width="340"> <p>
            <label for="address2" class="contactLable">Address 2:</label>
            <input name="address2" type="text" id="address2" tabindex="50" size="30" />
          </p></td>
  </tr>
  <tr>
    <td><p>
            <label for="town" class="contactLable">Town:</label>
            <input name="town" type="text" id="town" tabindex="60" size="30" />
          </p></td>
    <td><p>
            <label for="county" class="contactLable">County:</label>
            <input name="county" type="text" id="county" tabindex="70" size="30" />
          </p></td>
  </tr>
  <tr>
    <td><p>
            <label for="postcode" class="contactLable">Post Code:</label>
            <input name="postcode" type="text" id="postcode" tabindex="80" size="10" />
          </p></td>
    <td> </td>
  </tr>
  <tr>
    <td><p>
            <label for="propertyType" class="contactLable">Property Type:</label>
            <select name="propertyType" id="propertyType" tabindex="90">
              <option>Please select</option>
              <option>Detached</option>
              <option>Semi-Detached</option>
              <option>End of Terrace</option>
              <option>Mid-Terrace</option>
              <option>Flat</option>
              <option>Bungalow</option>
              <option>Cottage</option>
              <option>Other</option>
            </select>
          </p></td>
    <td><p>
            <label for="propertyArea" class="contactLable">Property Area:</label>
            <select name="propertyArea" id="propertyArea" tabindex="100">
              <option>Please select</option>
              <option>None</option>
              <option>Listed Building</option>
              <option>Conservation Area</option>
            </select>
          </p></td>
  </tr>
</table>
</p>
       </fieldset><fieldset><legend><strong>Project Type</strong></legend>
          <table width="690">
            <tr>
              <td width="338"><label>
                <input name="rearExt" type="checkbox" class="contactCheckbox" id="CheckboxGroup1_0" tabindex="110" value="rearExt"/>
              Rear ground extension</label></td>
              <td width="340"><input name="sideExt" type="checkbox" class="contactCheckbox" id="CheckboxGroup1_1" tabindex="120" value="sideExt"/>
Side ground extension</td>
            </tr>
            <tr>
              <td><input name="twoStoreyRear" type="checkbox" class="contactCheckbox" id="twoStoreyRear" tabindex="130" value="twoStoreyRear"/>
Two-storey rear extension</td>
              <td><input name="twoStoreySide" type="checkbox" class="contactCheckbox" id="twoStoreySide" tabindex="140" value="twoStoreySide"/>
Two-storey side extension</td>
            </tr>
            <tr>
              <td><input name="loft" type="checkbox" class="contactCheckbox" id="loft" tabindex="150" value="loft"/>
Loft conversion </td>
              <td><input name="newBuild" type="checkbox" class="contactCheckbox" id="newBuild" tabindex="160" value="newBuild"/>
New build </td>
            </tr>
            <tr>
              <td><input name="flat" type="checkbox" class="contactCheckbox" id="flat" tabindex="170" value="flat"/>
Flat conversion</td>
              <td><input name="other" type="checkbox" class="contactCheckbox" id="other" tabindex="180" value="other"/>
Other conversion</td>
            </tr>
          </table>
        </fieldset>
        <fieldset><legend><strong>Message</strong></legend>
          <p>
            <label for="message" class="contactLable">Your Message or Comments:</label>
            <textarea name="message" id="message" cols="45" rows="5" tabindex="190"></textarea>
          </p>
        </fieldset>
        <br />
        <input type="submit" name="Sumbit" id="Sumbit" value="Submit" tabindex="200" />
      </form>
    </div>
PHP Coding to send to my email:
<!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" />
<META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
<title>Email Form</title>
</head>
<body>
<?php
  $name=addslashes($_POST['name']);
  $contact_number=addslashes($_POST['contact_number']);
  $email=addslashes($_POST['email']);
  $address1=addslashes($_POST['address1']);
  $address2=addslashes($_POST['address2']);
  $town=addslashes($_POST['town']);
  $county=addslashes($_POST['county']);
  $postcode=addslashes($_POST['postcode']);
  $propertyType=addslashes($_POST['propertyType']);
  $propertyArea=addslashes($_POST['propertyArea']);
  $rearExt=($_POST['rearExt'])?"Rear ground extension: Yes":"Rear ground extension: No";
  $sideExt=($_POST['sideExt'])?"Side ground extension: Yes":"Side ground extension: No";
  $twoStoreyRear=($_POST['twoStoreyRear'])?"Two-storey rear extension: Yes":"Two-storey rear extension: No";
  $twoStoreySide=($_POST['twoStoreySide'])?"Two-storey side extension: Yes":"Two-storey side extension: No";
  $loft=($_POST['loft'])?"Loft: Yes":"Loft: No";
  $newBuild=($_POST['newBuild'])?"New Build: Yes":"New Build: No";
  $flat=($_POST['flat'])?"Flat: Yes":"Flat: No";
  $other=($_POST['other'])?"Other: Yes":"Other: No";
  $msg.="\n$rearExt\n$wsideExt\n$twoStoreyRear\n$twoStoreySide\n$loft\n$newBuild\n$wflat\n$ other";
  $message=addslashes($_POST['message']);
// you can specify which email you want your contact form to be emailed to here
  $toemail = "[email protected]";
  $subject = "From Website Test";
  $headers = "MIME-Version: 1.0\n"
            ."From: \"".$name."\" <".$email.">\n"
            ."Content-type: text/html; charset=iso-8859-1\n";
  $body = "Name: ".$name."<br>\n"
            ."Email: ".$email."<br>\n"
            ."Contact No: ".$contact_number."<br>\n"
            ."Address1: ".$address1."<br>\n"
            ."Address2: ".$address2."<br>\n"
            ."Town: ".$town."<br>\n"
            ."County: ".$county."<br>\n"
            ."Postcode: ".$postcode."<br>\n"
            ."Property Type: ".$propertyType."<br>\n"
            ."Property Area: ".$propertyArea."<br>\n"
            ."Rear ground extension: ".$rearExt."<br>\n"
            ."Side ground extension: ".$sideExt."<br>\n"
            ."Two-storey rear extension: ".$twoStoreyRear."<br>\n"
            ."Two-storey side extension: ".$twoStoreySide."<br>\n"
            ."Loft conversion: ".$loft."<br>\n"
            ."New build: ".$newBuild."<br>\n"
            ."Flat: ".$flat."<br>\n"
            ."Other: ".$other."<br>\n"
            ."Message:<br>\n"
            .$message;
  if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
    echo "That is not a valid email address.  Please return to the"
           ." previous page and try again.";
    exit;
    mail($toemail, $subject, $body, $msg, $headers);
    echo "Thanks for submitting your comments";
?>
</body>
</html>

Dear David
Thank you so much for the clear explanation. I have been using Lynda.com Dreamweaver CS5 tutorial. I found the coding for checkbox through search and added to the coding from Lynda.com tutorial.
I made few changes to the coding by removing:
$msg = "$rearExt<br>\r\n$sideExt<br>\r\n$twoStoreyRear<br>\r\n
          $twoStoreySide<br>\r\n$loft<br>\r\n$newBuild<br>\r\n$flat<br>\r\n$other\r\n";
as the email message shows the results from the checkbox twice.
I also removed the <br> from:
$body = "Name: $name<br>\r\n
          Email: $email<br>\r\n
          Contact No: $contact_number<br>\r\n
         Other: $other\r\n
          Message:\r\n
            $message";
I have add the result and the PHP coding you have helped to fixed for anyone needing a working PHP code containing Text Fields, Drop Down List, Checkbox and Text Area. Many thanks for all your help. If you have a coding to change the heading text colour I very much appericate it.
Message sent to email:
          From: Name test <[email protected]>
             Content-type: text/html; charset=iso-8859-1
Name: Name test
          Email: [email protected]
                  Contact No: 0123456789
                  Address1: addy1
                  Address2: addy2
                  Town: T
                  County: C
                  Postcode: P/C
                  Property Type: End of Terrace
                  Property Area: Listed Building
                  Rear ground extension: Rear ground extension: No
                 Side ground extension: Side ground extension: No
                 Two-storey rear extension: Two-storey rear extension: Yes
                 Two-storey side extension: Two-storey side extension: No
                 Loft conversion: Loft conversion: No
                 New build: New Build: No
                 Flat: Flat: Yes
                 Other: Other: No
         Message:
           Test message
PHP coding for customer contact page:
<!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" />
<META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
<title>Email Form</title>
</head>
<body>
<?php
  $name=$_POST['name'];
  $contact_number=$_POST['contact_number'];
  $email=$_POST['email'];
  $address1=$_POST['address1'];
  $address2=$_POST['address2'];
  $town=$_POST['town'];
  $county=$_POST['county'];
  $postcode=$_POST['postcode'];
  $propertyType=$_POST['propertyType'];
  $propertyArea=$_POST['propertyArea'];
  $rearExt= isset($_POST['rearExt'])?"Rear ground extension: Yes":"Rear ground extension: No";
  $sideExt= isset($_POST['sideExt'])?"Side ground extension: Yes":"Side ground extension: No";
  $twoStoreyRear= isset($_POST['twoStoreyRear'])?"Two-storey rear extension: Yes":"Two-storey rear extension: No";
  $twoStoreySide= isset($_POST['twoStoreySide'])?"Two-storey side extension: Yes":"Two-storey side extension: No";
  $loft= isset($_POST['loft'])?"Loft conversion: Yes":"Loft conversion: No";
  $newBuild= isset($_POST['newBuild'])?"New Build: Yes":"New Build: No";
  $flat= isset($_POST['flat'])?"Flat: Yes":"Flat: No";
  $other= isset($_POST['other'])?"Other: Yes":"Other: No";
  $message=$_POST['message'];
// you can specify which email you want your contact form to be emailed to here
  $toemail = "[email protected]";
  $subject = "From Website Test";
  $headers = "MIME-Version: 1.0\r\n
             From: $name <".$email.">\r\n
             Content-type: text/html; charset=iso-8859-1";
  $body = "Name: $name\r\n
          Email: $email\r\n
          Contact No: $contact_number\r\n
          Address1: $address1\r\n
          Address2: $address2\r\n
          Town: $town\r\n
          County: $county\r\n
          Postcode: $postcode\r\n
          Property Type: $propertyType\r\n
          Property Area: $propertyArea\r\n
          Rear ground extension: $rearExt\r\n
          Side ground extension: $sideExt\r\n
          Two-storey rear extension: $twoStoreyRear\r\n
          Two-storey side extension: $twoStoreySide\r\n
          Loft conversion: $loft\r\n
          New build: $newBuild\r\n
          Flat: $flat\r\n
          Other: $other\r\n
          Message:\r\n
            $message";
  if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
    echo "That is not a valid email address.  Please return to the"
           ." previous page and try again.";
    exit;
    mail($toemail, $subject, $body, $headers);
    echo "Thanks for submitting your message";
?>
</body>
</html>

Similar Messages

  • AS2 contact form and php - works fine but only sends half of the text in the comments field ???

    hi all - i have an AS2 contact form using php to send the info to my email address - it all works fine except this ..... rather than having an empty comments box in the flash movie i had added a whole bunch of feedback questions that the user can comment yes/no to in the comments box (my feedback questions were added into the input text box in cs3 so are there when the user opens the contact page .. i have set the maximum characters to 10000 so no worries that its that that is stopping it all coming through in the email ..... basically when i go to my form online and send it i get it through as an email but with only three quarters of the feedback text in it ...... i have tried a zillion ways a round this, tried other contact forms and php and always end up with the same problem ... any ideas any one ?
    this is the AS....
    stop();
    a =0;
    function validate () {
        if (from.length>=7) {
            if (from.indexOf("@")>0) {
                if ((from.indexOf("@")+2)<from.lastIndexOf(".")) {
                    if (from.lastIndexOf(".")<(from.length-2)) {
                        a = 1;
                        // email is fine
    function formcheck () {
        validate ();       
        trace(a);
        if (fname = "" or telno eq "" or comments eq "" or from eq "") {
            stop();
            error = "You have left blank fields, please fill in all fields, thank you";
        } else {
            emailcheck ();
    function emailcheck (){
        if (a != 1){
            stop();
            error = "Email address not valid";
            } else {
            loadVariablesNum("mail.php3", 0, "POST");
            gotoAndStop(2);
    ..........this is the php
    <?php
    $adminaddress = "[email protected]";
    $sitename = "Flash Site Form Mailer";
    mail("$adminaddress","Info Request",
    "A customer at $sitename has made the following enquiry\n
    First Name: $name
    Company Name: $company
    Telephone: $telno
    Email: $from\n
    The visitor commented:
    $comments
    Logged Info :
    Using: $HTTP_USER_AGENT
    Hostname: $ip
    IP address: $REMOTE_ADDR
    Date/Time:  $date","FROM:$adminaddress");
    ?>
    any help much appreciated

    i think you should not use $HTTP_USER_AGENT.
    and use loadvars instead of loadvariablesnum:
    stop();
    a =0;
    function validate () {
        if (from.length>=7) {
            if (from.indexOf("@")>0) {
                if ((from.indexOf("@")+2)<from.lastIndexOf(".")) {
                    if (from.lastIndexOf(".")<(from.length-2)) {
                        a = 1;
                        // email is fine
    function formcheck () {
        validate ();       
        trace(a);
        if (fname = "" or telno eq "" or comments eq "" or from eq "") {
            stop();
            error = "You have left blank fields, please fill in all fields, thank you";
        } else {
            emailcheck ();
    var sendLV:LoadVars=new LoadVars();
    function emailcheck (){
        if (a != 1){
            stop();
            error = "Email address not valid";
            } else {
    sendLV.name=fname;
    sendLV.telno=telno;
    sendLV.company=company;  //assuming company is a variable in your flash
    sendLV.comments=comments;
    sendLV.send("mail.php3", "POST");
            gotoAndStop(2);
    //..........this is the php
    <?php
    $adminaddress = "[email protected]";
    $sitename = "Flash Site Form Mailer";
    $from=?;//you need to define this variable
    $name=$_POST['name'];
    $telno=$_POST['telno'];
    $company=$_POST['company'];
    $comments=$_POST['comments'];
    $body=
    "A customer at $sitename has made the following enquiry\n
    First Name: $name
    Company Name: $company
    Telephone: $telno
    Email: $from\n
    The visitor commented:
    $comments";
    mail($adminaddress,"Info Request",$body);
    ?>

  • Contact form check boxes will not work on a Tablet

    Hi there,
    I created a website (Desktop) and a mobile version (Phone).  I did not create one for a tablet but have relied on the Desktop version if someone views it on a Tablet.
    Here's the thing, I created a contact form with checkboxes.  It works great on a desktop (because people check the boxes with their mouse), however, it doesn't work on a Tablet, when you try and check the boxes with your finger.
    Help!

    Please share the site URL.

  • Contact form to PHP - blank window

    Hi!
    Here's the deal.
    I have a small contact form, just 4 fields.
    It sends text from the input fields to a PHP mail script,
    which emails it.
    Everything works great, but when I click the SEND button I
    also get a new blank window over the site window.
    Someone told me I have to put :Void() in some function in my
    Actionscript code, by I don't know where.
    Here's the AS code and then the mail script:
    I really need to get this right in order to get paid:D
    Thanks!!!
    Igor

    use sendAndLoad() and use a 2nd loadvars instance. use the
    onData() method of your receiving loadvars instance to see your
    error message.

  • Create HTML Contact Form with PHP script

    Hi Everyone
    I have designed a contact form in HTML with PHP script but it doesn't seem to be working. The PHP echo message doesn't appear after I submit the form and the e-mail message is not delivered.  The url address is http://www.dreamaustraliastudytours.com.au/Test/ContactUs.html. Any thoughts would be greatly apprecipated
    Thank you in advance
    Paul

    Hi Ben and Murray
    Thank you for your input on the php script. You nailed the problem on the head. I have up dated the script  and provided it below. I have one more question.
    After the end user submits the form I would like them to be directed to another html file - for example successful.html. Would the code be
    $insertGoTo = "successful.html";
    delete 'Thank you for contacting us. We will be in touch with you very soon.'?
    Once again thank you for your advice
    Regards
    Paul
    <?php
    if(isset($_POST['email'])) {
        $email_to = "[email protected]";
        $email_subject = "New Inquiry";
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        // validation expected data exists
        if(!isset($_POST['first_name']) ||
            !isset($_POST['last_name']) ||
            !isset($_POST['email']) ||
            !isset($_POST['telephone']) ||
            !isset($_POST['comments'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');      
        $first_name = $_POST['first_name']; // required
        $last_name = $_POST['last_name']; // required
        $email_from = $_POST['email']; // required
        $telephone = $_POST['telephone']; // not required
        $comments = $_POST['comments']; // required
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
        $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
        $string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$first_name)) {
        $error_message .= 'The First Name you entered does not appear to be valid.<br />';
      if(!preg_match($string_exp,$last_name)) {
        $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
      if(strlen($comments) < 2) {
        $error_message .= 'The Comments you entered do not appear to be valid.<br />';
      if(strlen($error_message) > 0) {
        died($error_message);
        $email_message = "Form details below.\n\n";
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        $email_message .= "First Name: ".clean_string($first_name)."\n";
        $email_message .= "Last Name: ".clean_string($last_name)."\n";
        $email_message .= "Email: ".clean_string($email_from)."\n";
        $email_message .= "Telephone: ".clean_string($telephone)."\n";
        $email_message .= "Comments: ".clean_string($comments)."\n";
    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    ?>
    Thank you for contacting us. We will be in touch with you very soon.
    <?php
    ?>

  • Contact form without PHP Help!

    I'm trying to create a contact form to send an email to me
    when they click on the submit button. I'm using the "getUrl and
    Mailto). It works when I set the variables manually, but I can't
    get it to store the value of the user input fields to use in my
    message body.
    This has got to be a simple matter of syntax or placement of
    the var function. Please forgive me for being such a newbee!
    Thanks in advance for any help.

    I don't think you're going to have any luck processing a contact form without the support of some server-side scripting that is capable of interacting with the server.

  • Flash Contact form with Php Error

    Hi again (".)
    I've making this contact form on flash & i got  the script  for the action script but i'm unable to integrate a php script that would send the mail from my form.
    I'm using two input feilds with instance names as theEmail and theMessage
    Would relly appreciate it if i culd get some help on it. thank you so much.
    Here is the action action script code i'm using -
    snd_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
              if (theEmail.text == "" || theMessage.text == "")
                        theFeedback.text = "Please fill in all fields.";
              else
                        // create a variable container
                        var allVars:URLVariables = new URLVariables();
                        allVars.email = theEmail.text;
                        allVars.message = theMessage.text;
                        //send info to a URL
                        var mailAddress:URLRequest = new URLRequest("mail.php");
                        mailAddress.data = allVars;
                        mailAddress.method = URLRequestMethod.POST;
                        sendToURL(mailAddress);
                        theFeedback.text = "Thank You!";
      theEmail.text = "";
                        theMessage.text = "";

    Actaully is i got this Action script from a tutorial and i learnt from it but the mail.php was not part of the tutorial.
    Would you be able to provide me a php script based on the instances names i mention above?

  • Cant contact Adobe re product that doesnt work

    I recently purched Adobe PDF to word converter (on line version). It worked for a few weeks but has now crashed.
    I have looked all over the website for an e-mail address or phone number to contact someone regarding this but cannot find one.
    Can anybody help please.

    Hello Phil,
    Sorry to hear you're having trouble with ExportPDF. Could you provide some more detail about the trouble you're facing?
    -David

  • Simple contact form php error

    I just replaced an adobe formscentral contact form with the muse simple contact form. It is not working, receiving a php server error when submitting. How can I fix this?? I'm hosting through Amazon Route53.
    Issue is here: CONTACT

    Hi,
    I was able to submit the form, kindly let me know if you are still facing the issue.
    Regards
    Sonam

  • What are the best customizable contact forms that work with Godaddy?

    Hello,
    I have never had much look with getting contact forms to work but i'm not sure whether it may just be the contact forms i choose don't work through Godaddy that well.
    Can anyone point me in a direction to any customizable contact forms that do work through Godaddy. PHP script needs to be included.
    Any help would be greatly appreciated as this has bugged me for some time now.
    Alex.

    Depends on the level of hosting you have.
    Using Our PHP Form Mailers on Web & Classic Hosting | GoDaddy Help | GoDaddy Support
    GoDaddy hosts 2 form-to-email processing scripts in PHP.  You activate them from your CPanel.
    One is super basic and the easiest to set-up
    Using gdform.php
    The other has a little more room for customization but it isn't exactly robust.
    Using webformmailer.php
    Nancy O.

  • Need help with PHP contact form

    Hi guys,
    I've made a PHP contact form for my site and need help with a couple of things:
    The form action links an external PHP script (scripts/contact-form-script.php) but is there a way I can have it so the PHP script for the form is contained within the same PHP file as my contact form (contact.php)?
    I tried just putting the form code at the top of contact.php but the browser automatically reads the anti-spam re-direct, so maybe that needs revising too?
    The second thing is, how can I make the Name, Email and Message fields mandatory? So if a user tries to submit the form and hasn't filled in one of the required fields and clicks submit, contact.php reloads with a message at the top of the form saying something like 'Complete the required fields' and highlights the relevant field with a red border?
    Here's the code for contact.php:
    <form action="http://www.mydomain.com/scripts/contact-form-script.php" method="post" name="contact" id="contact">
    <p><strong>Name:*</strong><br />
    <input name="name" type="text" class="ctextField" /></p>
    <p><strong>E-mail:*</strong><br />
    <input name="email" type="text" class="ctextField" /></p>
    <p><strong>Telephone:</strong><br />
    <input name="telephone" type="text" class="ctextField" /></p>
    <p><strong>Company:</strong><br />
    <input name="company" type="text" class="ctextField" /></p>
    <p><strong>Address:</strong><br />
    <input name="address1" type="text" class="ctextField" /></p>
    <p><input name="address2" type="text" class="ctextField" /></p>
    <p><strong>Town:</strong><br />
    <input name="town" type="text" class="ctextField" /></p>
    <p><strong>County:</strong><br />
    <input name="county" type="text" class="ctextField" /></p>
    p><strong>Postcode:</strong><br />
    <input name="postcode" type="text" class="ctextField" /></p>
    <p><strong>Message:*</strong><br />
    <textarea name="message" cols="55" rows="8" class="ctextField"></textarea></p>
    <p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    And this is the PHP I'm using to submit the form data for contact-form-script.php:
    <?php
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $to = "[email protected]";
    $subject = "Contact from website";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
            $message= '
                <table cellspacing="0" cellpadding="8" border="0" width="500">
                <tr>
                    <td colspan="2"></td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td width="154" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Name</strong></td>
                  <td width="314" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$name.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>E-mail address:</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$email.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Telephone number:</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$telephone.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Company:</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$company.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Address</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address1.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address2.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Town</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$town.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>County</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$county.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Postcode</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$postcode.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                    <td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Message</strong></td>
                </tr>              
                <tr bgcolor="#eeeeee">
                    <td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$message.'</td>
                </tr>              
                <tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
             </table>
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mydomain.com/sent.php' ) ;
    ?>
    Any help on this would be greatly appreciated.
    Thank you and I hope to hear from you!
    SM

    Revised code with form validation for Name Email and Message:
    <?php
    if (array_key_exists('submit', $_POST)) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
        $company = $_POST['company'];
        $address1 = $_POST['address1'];
        $address2 = $_POST['address2'];
        $town = $_POST['town'];
        $county = $_POST['county'];
        $postcode = $_POST['postcode'];
        $formMessage = $_POST['message'];
    if (empty($name)) {
                                                $warning['name'] = "Please provide your name";
    if (empty($email)) {
                                                $warning['email'] = "Please provide your email";
    if (empty($formMessage)) {
                                                $warning['message'] = "Please provide your message";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $to = "[email protected]";
    $subject = "Contact from website";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
            $message= "
    <table cellspacing='0' cellpadding='8' border='0' width='500'>
                <tr>
                    <td colspan='2'></td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td width='154' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Name</strong></td>
                  <td width='314' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$name."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>E-mail address:</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$email."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Telephone number:</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$telephone."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Company:</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$company."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Address</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address1."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address2."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Town</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$town."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>County</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$county."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Postcode</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$postcode."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                    <td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Message</strong></td>
                </tr>              
                <tr bgcolor='#eeeeee'>
                    <td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$formMessage."</td>
                </tr>              
                <tr><td colspan='2' style='padding: 0px;'><img src='images/whitespace.gif' alt='' width='100%' height='1' /></td></tr>
             </table>
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mydomain.com/sent.php' ) ;
    ?>
    <!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>
    <style type="text/css">
    p {
        margin: 0;
        padding: 10px 0 0 0;
    .warning {
        color:#C00;
    </style>
    </head>
    <body>
    <form action="" method="post" name="contact" id="contact">
    <p><strong>Name:*</strong><br />
    <input name="name" <?php if (isset($warning['name'])) { echo "style='border: 1px solid #C00'"; } ?> type="text" class="ctextField" />
    <?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['name']."</p>"; }?>
    </p>
    <p><strong>E-mail:*</strong><br />
    <input name="email" <?php if (isset($warning['email'])) { echo "style='border: 1px solid #C00'"; } ?>type="text" class="ctextField" />
    <?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['email']."</p>"; }?>
    </p>
    <p><strong>Telephone:</strong><br />
    <input name="telephone" type="text" class="ctextField" /></p>
    <p><strong>Company:</strong><br />
    <input name="company" type="text" class="ctextField" /></p>
    <p><strong>Address:</strong><br />
    <input name="address1" type="text" class="ctextField" /></p>
    <p><input name="address2" type="text" class="ctextField" /></p>
    <p><strong>Town:</strong><br />
    <input name="town" type="text" class="ctextField" /></p>
    <p><strong>County:</strong><br />
    <input name="county" type="text" class="ctextField" /></p>
    <p><strong>Postcode:</strong><br />
    <input name="postcode" type="text" class="ctextField" /></p>
    <p><strong>Message:*</strong><br />
    <?php if (isset($warning['message'])) { echo "<p class='warning'>".$warning['message']."</p>"; }?>
    <textarea name="message" <?php if (isset($warning['message'])) { echo "style='border: 1px solid #C00'"; } ?> cols="55" rows="8" class="ctextField"></textarea></p>
    <p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    </body>
    </html>

  • Contact forms on third party hosting

    Contact form not working on site hosted with godaddy.  I've looked at a number of threads on here and this seems to be a common problem with no real answers.  As I understand it, contact forms since version 7 should work on other hosting platforms (other than business catalyst)  I've just uploaded a site to godaddy via ftp but the contact form is not working correctly.  I've been on to godaddy support but it is still not resolved and they are out of ideas.  Does anyone know exactly what php settings should be?  I've run the muse php diagnostic and seem to have an sql configuration problem.  As a last resort I'll change the forms to jotform but feel that there must be a solution for the contact forms widget supplied within muse, especially for a major hosting company such as godaddy.  Any help greatly appreciated!

    Hi Gaurav,
    Yes I've been through the guide and I've used the php diagnostic and there is a problem with the sql settings.  I've been in contact with godaddy support to try and sort the server side php settings, they have done what they can but are out of ideas. I'm sure with godaddy being one of the major hosting companies that this has been tackled before.  Do you know what the php settings should be for muse forms to work?

  • I have been looking everywhere on how to code a contact form with as3

    I wouldn't think it is such an uncommon thing, but I have been unable to find tutorials past flash 5, or as2, on how to code contact forms.
    I have a simple movieclip symbol, with text fields, all with instance names, and need to find out how to pass the information from flash to a php
    script.  If anyone can help, or atleast point me towards a tutorial that uses something newer than flash 5 and newer than 2004, it would be awesome.

    Would any of these work?
    http://www.webdesignmo.com/blog/2008/08/14/flash-contact-form-in-actionscript-3/
    check this one first:
    http://www.kirupa.com/forum/showthread.php?t=272898
    http://www.edesignerz.net/flash/527--flash-cs3-as3-contact-form-with-php-parser-actionscri pt-3-video-tutorial
    Hope this helps!

  • Contact form not allowing certain characters

    Hi
    I added a contact form to a site, and the input fields aren't allowing numbers or certain letters.
    If I test the contact form swf by itself, it works fine.  But as soon as I test it in the site, the problem occurs.
    I haven't got any other actionscript around the contact form, so am puzzled.
    I would sure appreciate someone taking a look to see if anything obviou is wrong.
    The site is www.skinrevival.com.au  - the contact link is on the bottom left menu.
    Cheers guys
    Shaun

    U should enable the Numerals and puctuation to accept the special and number chanacters. find the attached image for your reference.
    Thanks
    Thil

  • I NEED HELP! Making a flash email form using php.

    Hi, my name is Sean, I'm making a flash contact form using php for a website.
    I'm having a hard time with the php. Can some one help?
    Click here to download my source.

    Satellite A505-S6005 
    ACPI Flash BIOS version 1.40 for Satellite A500/A505 (PSAT6U/PSAT9U)
    When you execute the download file (sat6v140.exe) it decompresses into several files in the sat6v140 folder. 
    Among those, is the readme.txt attached, which explains how to create the CD.
       Burn a CD or DVD from an ISO file
    -Jerry
    Attachments:
    readme.txt ‏14 KB

Maybe you are looking for

  • How to pupup the calendar value into text box ?

    Hi I want to use the calendar for my text field . The calendar will popup when I click a button /image. This image will appear next to text box . when click the calendar. The values should come to into text box. Please give me any idea how to write a

  • Text characters displayed as # on Bex analyzer (excel)

    Hi all, I am having issues with Turkish Charaters displayed on the report output on Bex analyser. The Turkish text characters in the fields like Name 1, Name 2, city are displayed in # format.  This is happening only when the report is executed on Be

  • Moving data from Materialized View to downstream application

    Database Version: 9i Release 2 I've created a Materialized View on a base table, the purpose of which is to capture data changes to send to a downstream application (I've been advizsed to avoid using Streams for now until we upgrade to 10g) I need to

  • Offline in fiori lauchpad

    Hi experts, I have  a requirement where i need to implement offline feature for applications in fiori lauchpad. For example suppose i login to the fiori launchpad , say i have 5 - 6 applications. Now i need those applications to run when i go offline

  • Playlist shuffle view changed with update

    Hi all, I recently upgraded to version 8.0.2.20 and installed Genius. Since then, I have noticed that my shuffled playlists are displaying differently. Previously when I shuffled my tracks the songs would appear in shuffled order. Now iTunes just ski