Contact Form - Email responsive is blank

Hello all,
PHP has been created for an web form:
the issue is when i complete the form and SEND , i receive the email but its blank i only have this
Name:
tel:
email:
description:
here is the PHP
<?php
/* Email Variables */
$emailSubject = 'contactformprocess!'; /*Make sure this matches the name of your file*/
$webMaster = 'xxxxxxxx';
/* Data Variables */
$name = $_POST['name'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$description = $_POST['description'];
$body = <<<EOD
<br><hr><br>
Name: $FormName <br>
Tel: $Tel <br>
Email: $FormEmail <br>
Description: $Description <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;xxxxxxxxxxxxxx/contact.html">
<style type="text/css">
<!--
body {
background-color: #666
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
-->
</style>
</head>
<div align="center">Thank you for your interest! Your message has been successfully sent and we will get back to you shortly! </div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
this is the contact.html
<form action="contactformprocess.php" method="post" enctype="text/plain" name="form1" id="form1">
          <table width="473" height="322" border="0">
            <tr>
              <td width="86" height="61"><label for="Name"> Name</label></td>
              <td width="377"><span id="sprytextfield1">
              <input name="Name" type="text" id="Name" size="35" maxlength="90" />
              <span class="textfieldRequiredMsg">A value is required.</span></span><br /></td>
            </tr>
            <tr>
              <td height="60"><label for="Tel">Tel</label></td>
              <td><span id="sprytextfield2">
              <input name="Tel" type="text" id="Tel" size="35" maxlength="11" />
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
            </tr>
            <tr>
              <td height="49"><label for="Email">Email</label></td>
              <td><span id="sprytextfield3">
              <input name="Email" type="text" id="Email" value="" size="35" />
              <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
            </tr>
            <tr>
              <td><label for="Description">Description</label></td>
              <td><span id="sprytextarea1">
                <textarea name="Description" id="Description" cols="35" rows="5"></textarea>
              <span class="textareaRequiredMsg">A value is required.</span></span></td>
            </tr>
            <tr>
              <td><label for="Submit"></label>
              <input type="reset" name="Reset" id="Submit" value="Reset" /></td>
              <td><label for="Reset:"></label>
              <input type="submit" name="Reset:" id="Reset:" value="Send Email" /></td>
            </tr>
          </table>
        </form>
can anybody tell me what is wrong with the php or the form.
thank you

/* Data Variables */
$name = $_POST['name'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$description = $_POST['description'];
$body = <<<EOD
<br><hr><br>
Name: $FormName <br>
Tel: $Tel <br>
Email: $FormEmail <br>
Description: $Description <br>
NONE of your populated variables match the variables you are using in the email body so of couse it can not work. Variables must match exactly and PHP variable names are case sensitive. I'll guess that you mean to do this:
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Tel: $tel <br>
Email: $email <br>
Description: $description <br>

Similar Messages

  • Web Form Email Response Layout

    Hi All,
    I have a working web form that successfully sends plain text responses to my email address on submit
    Below is an example of the response i receive...
    Enquiry_Type:
    General Enquiry
    Name_Of_Sender:
    Jack Tyler
    Sender_Email__Address:
    [email protected]
    Message:
    Does This Work?
    submit:
    Send Message
    I have a couple of queries...
    1) How can i remove the submit:Send Message button from the reply.
    2) I would like to add formatting options to the reply so the questions are bold and the answer is in normal text. Also i would like to add a line between each section so that each section is clearer to read and less clustered. I have read about HTML email responses but I am unsure if this is the best option for me to use.
    Any help would be appreciated

    Hi the web form using the code is available here http://hfcc.0catch.com/contact.html.
    The code i am using is listed below.
    I hope this is what you needed,
    Thanks
      <?
    error_reporting(E_ALL);
    ******** Secure mailing script *****************
    ******** Copyright David Wilde *****************
    You can add your template to this page.
    Make your form action value the absolute or relative path to the location of this script once it is uploaded to your site.
    Example;
    Absolute path: <form method="post" action="http://www.yourdomain.com/scripts/mailprocess.php">
    OR relative path: <form method="post" action="scripts/mailprocess.php">
    Assuming you have a scripts folder and you upload the script to that folder.
    The script Checks that all fields contain information and validates the email address.
    You must have the email text field in your form set with the name of 'email' the name is case sensative, so make sure it is in lowercase.
    // Start config variables
    // ONLY CHANGE THE DETAILS IN BETWEEN THE QUOTES; E.G '[email protected]'
    $to='root@localhost'; // You must change this! This should be the email address you want the form information sent to.
    $subjectline='Website Feedback - Contact Us'; // The email subject line. You may leave this as is.
    ## Do Not Edit Below this Line ##
    $thanks=header('Location:http://localhost/HFCC/Email_Responses/Childcare_App_Response.html'); // This is the message given after successfull submission of form.
    $failed=header('Location:http://localhost/HFCC/Email_Responses/failed.html'); //This is the message given after message was unable to sumbit to sender.
    // The ['email'] should match the name= in the email text input box in your form. Used for email validation.
    // DO NOT CHANGE THIS HERE. Change your form to match this.
    $email = $_POST['email'] ; // collect users email from form for the email header.
    // Collect all information from form and check all fields have been filled in.
    if (sizeof($_POST)) {
    $body = "";
    while(list($key, $val) = each($_POST)) {
    if ($key == "Submit") {
    //do nothing
    else {
    $body .= "$key:\n $val\r\n";
    // Checks if $val contains data
    if(empty($val)) {
    /*echo ("<b><p><li>One or more required fields have not been filled in.</li></p>
    <p><li>Please go <a href='javascript: history.go(-1)'>Back</a> and try again</li></p></b>");
    exit();*/
    // Validate email address
    /*if(!preg_match("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
    echo ("<b><li>Invalid email address entered. Go <a href='javascript: history.go(-1)'>Back</a> and try again</li></b>");
    exit();
    // Clean up email address
    if (get_magic_quotes_gpc()){
    $email = stripslashes($email);
    // Set headers
    $security = "From: ".$email."\r\n";
    $security .= "Reply-To: ".$email."\r\n";
    $security .= "Return-Path: \r\n";
    $security .= "CC: \r\n";
    $security .= "BCC: \r\n";
    ini_set("sendmail_from", $email);
    // Send the email.
    if ( mail($to, $subjectline, $body, $security, "-f".$email)) {
    echo $thanks;
    } else {
    echo $failed;
    ?>

  • How do you set up a contact form with response in Muse?

    Contact forms are so easy in WordPress, there must be a way to set one up in Muse when a third party (1and1) is hosting your site.

    And why don't you simply use one of the built in form widgets? They work fine with 1and1.

  • Acrobat Pro 7.0 form creation, email responses are blank

    I created a fill in form for email submission in Adobe Designer 7.0.  Some of the responses are coming back blank and some are coming back with the data.  What is the difference and how can I quickly correct this?
    Wendy Sheasley

    You should really ask in the Designer forum since that is the product you used to create the form (even if you did not realize it). In that sense I agree with Michael. However, just have the folks send back the form data, not the entire form. This saves a lot on the size of the e-mail and also means you have no limits since it does not have to be saved in the PDF. The data can then be imported into the FORM.
    It is typical for folks to start by trying to submit by e-mail. That is dangerous since it depends on the client machine over which you typically have no control. If possible, it is always best to try to submit to a web script.

  • Contact Form - Email forwarding from user submitted forms

    How can one have the user's submitted email address in the from dialog instead of the adobe user account email. My client would like to be able to use the reply button in there email client instead of starting a new email. At the moment all the submitted forms come from my adobe account and use my name instead of the user's name the submitted the form. This makes tracking submitted forms more difficult. Is there a solution available?
    Thanks,
    Graeme

    You can set the 'from' email address after you log in to your website admin.
    You can get there by clicking the 'manage' button in Muse, or pointing your browser to yoursite.businesscatalyst.com/admin
    Then click 'Site Manager', then 'System Emails', then 'Set Default 'From' Email'

  • How can I direct all my contact form replies (from my website), to my personal email address?

    How can I direct all my contact form replies (from my website), to my personal email address?
    I have embedded the code to my website but would like all of my contact form replies to be directed to my email address. How can I do this by revising the embedded code. Also will I still be able to receive replies after recieving 5000? At this point will I need a premium account?

    Email notifications are a feature of the Basic and Plus account.
    The free account only allows for 50 responses. The Plus (Premium) account allows for 5000.
    Randy

  • ColdFusion contact form by email - please help

    Hello,
    I tried to create a contact form, using email to send, and I
    have some issues and questions:
    1. I like to have a message "Your form has been sent", but it
    shows the blank after user submited the form.
    2. If user enter her email address, this form will send to
    her email address and me, but it does not send to her email
    address.
    Can anyone please take a look at my code below?
    Why I don't get the output (result) I like to have?
    Thanks very much.
    Jenny.
    <cfif IsDefined("form.Subject")>
    <cfprocessingdirective suppresswhitespace="no">
    <cfmail subject="#form.Subject#" from="#form.From#"
    to="[email protected]" >
    This is a message from that form...
    #form.Message#
    </cfmail>
    </cfprocessingdirective>
    <cfelse>
    <cfform action="#CGI.SCRIPT_NAME#" method="post"
    name="frmName">
    name <cfinput type="text" name="Name" size="20"><br
    />
    email <cfinput type="text" name="Email"
    size="20"><br />
    Subject <cfinput type="text" name="Subject"
    size="20"><br />
    Message <textarea name="Message" cols="30" rows="3"
    ></textarea><br />
    <input type="submit" value="Submit it" />
    </cfform>
    <cfif isDefined("FORM.Name")>
    <cfmail subject="#form.Subject#" from="#form.From#"
    to="#Email#" >
    </cfif>
    <cfif isDefined("FORM.Submit")>
    <p>Your message has been sent</p>
    <cfelse>
    <cflocation addtoken="no" url="survey2.cfm">
    </cfif>

    I always start my troubleshooting with
    <cfdump var="#form#">
    <cfabort>
    You also have a problem with an cfmail tag without the
    closing tag. I'm surprised that didn't cause a crash.
    You also have some problems with your if/else logic.

  • Spry Contact Form doesn't show all the information on email

    Hi there,
    So I have created a contact form with the spry text fields.
    The text fields are:
    Name
    Email
    Message
    Onced tested the email shows:
    Name     : [email protected]
    Email     :  (blank)
    Message: (blank)
    So The two issues is that is shows the email shows under name and the email and message sections dont show any infomation at all.
    Link is here
    Thanks in advance
    Ash

    The best way is to have no separate action page and lump the whole lot into one document.
    The following is an example of this
    <?php
    if(isset($_POST['Email'])) {
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "[email protected]";
        $email_subject = "Your email subject line";
        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['Name']) ||
            !isset($_POST['Email']) ||
            !isset($_POST['message'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');     
        $name = $_POST['Name']; // required
        $email_from = $_POST['Email']; // required
        $comments = $_POST['message']; // 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,$name)) {
        $error_message .= 'The 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 .= "Name: ".clean_string($name)."\n";
        $email_message .= "Email: ".clean_string($email_from)."\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);
    ?>
    <!-- include your own success html here -->
    <p class="message">Thank you for contacting us. We will be in touch with you very soon.</p>
    <?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>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
    <style>
    .message {
        font-size: 1.4em;
        color: #F00;
    </style>
    </head>
    <body>
    <h1>Contact Us</h1>
    <p>Please use any of the below methods to contact us for any enquiries or questions you may have</p>
    <p>Email : <a href="mailto:[email protected]">[email protected]</a></p>
    <form id="formmail" name="formmail" method="post" action="">
      <p id="nametextfield2">
        <label for="Name"></label>
        <input type="text" name="Name" id="Name" />
        <span class="textfieldRequiredMsg">A value is required.</span>
        <span class="textfieldMinCharsMsg">Minimum number of characters not met.</span>
        <span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span>
      </p>
      <p id="emailtextfield3">
        <label for="Email"></label>
        <input type="text" name="Email" id="Email" />
        <br />
        <span class="textfieldRequiredMsg">A value is required.</span>
        <span class="textfieldInvalidFormatMsg">Invalid format.</span>
      </p>
      <p id="messagetextarea1">
        <label for="message"></label>
        <textarea name="message" id="message" cols="45" rows="5"></textarea>
        <span id="countmessagetextarea1"> </span>
        <span class="textareaRequiredMsg">A value is required.</span>
        <span class="textareaMinCharsMsg">Minimum number of characters not met.</span>
        <span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span>
      </p>
      <p>
        <input type="submit" name="Submit" id="Submit" value="Submit" />
      </p>
    </form>
    <script type="text/javascript">
    var sprytextfield2 = new Spry.Widget.ValidationTextField("nametextfield2", "none", {hint:"Name", minChars:1, maxChars:50, validateOn:["blur"]});
    var sprytextfield3 = new Spry.Widget.ValidationTextField("emailtextfield3", "email", {validateOn:["blur"], hint:"Email"});
    var sprytextarea1 = new Spry.Widget.ValidationTextarea("messagetextarea1", {minChars:1, maxChars:400, validateOn:["blur"], counterType:"chars_remaining", counterId:"countmessagetextarea1", hint:"Message"});
    </script>
    </body>
    </html>
    Down the track you will be able to hide the form once it has been submitted.
    Gramps

  • 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.

  • Contact form response message not working

    So i am trying to move the location of my response message after the send button has been hit by the user. It comes up at the top of the screen but I want it to appear in a div just below. I read that using javascript should work. Here's what ive put:
    PHP:
    <?php
    if ($_POST){
    if (!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)){
    $message="Please provide a correct email address";} else {
      $fname = strip_tags($_POST['fname']);
      $sname = strip_tags($_POST['sname']);
      $telephone = strip_tags($_POST['tel']);
      $email = $_POST['email'];
      $comments = strip_tags($_POST['comments']);
      $to = '[email protected]';
      $subject = 'Contact form submitted.';
      $body = $fname. "\n". $sname. "\n". $comments;
      $headers = 'From: ' .$email;
      if (mail($to, $subject, $body, $headers)) {
      echo 'Thanks for contacting us. We\'ll be in touch soon!';
      } else {
      $message = 'Sorry an error occurred. Please try again later.';
    ?>
    <?php echo "<p style='color:red'>$message</p>"; ?>
    Form:
    <div class="contact_form">
    <table class="table">
      <tbody>
    <form id="contactForm" action="" method="post">
        <tr>
          <th scope="row">First Name:</th>
          <td><textarea name="fname"  cols="100" rows="3" id="fname"></textarea></td>
        </tr>
        <tr>
          <th scope="row">Surname:</th>
          <td><textarea name="sname" cols="100" rows="3" id="sname"></textarea></td>
        </tr>
        <tr>
          <th scope="row">Email Address:</th>
          <td><textarea name="email" cols="100" rows="3" id="email"></textarea></td>
        </tr>
        <tr>
          <th scope="row">Telephone Number:</th>
          <td><textarea name="tel" cols="100" rows="3" id="tel"></textarea></td>
        </tr>
        <tr>
          <th scope="row">Comments:</th>
          <td><textarea name="comments" cols="100" rows="10" id="comments"></textarea></td>
        </tr>
        <tr>
          <th scope="row"></th>
          <td height="40px"><input type="submit"></td>
        </tr>
        <tr>
        </form>
        </tr>
      </tbody>
    </table>
    Javascript:
    <script type="text/javascript" src="morris_construction/jquery-1.11.2.min.js"></script>
    <script>
         $("#contactForm").submit(function(event)
             /* stop form from submitting normally */
             event.preventDefault();
             /* get some values from elements on the page: */
             var $form = $( this ),
                 $submit = $form.find( 'button[type="submit"]' ),
                 fname_value = $form.find( 'input[name="fname"]' ).val(),
      sname_value = $form.find( 'input[name="sname"]' ).val(),
      tel_value = $form.find( 'input[name="tel"]' ).val(),
                 email_value = $form.find( 'input[name="email"]' ).val(),
                 comments_value = $form.find( 'textarea[name="comments"]' ).val(),
                 url = $form.attr('action');
             /* Send the data using post */
             var posting = $.post( url, {
                               fname: fname_value,
        sname: sname_value,
        tel: tel_value,
                               email: email_value,
                               comments: comments_value
             posting.done(function( data )
                 /* Put the results in a div */
                 $( "#contactResponse" ).html(data);
                 /* Change the button text. */
                 $submit.text('Sent, Thank you');
                 /* Disable the button. */
                 $submit.attr("disabled", true);
    </script>
    </div><!-- end of contact form -->

    No javascript needed or desired for this solution.
    Instead of
    echo 'Thanks for contacting us. We\'ll be in touch soon!';
      } else {
    echo 'Sorry an error occurred. Please try again later.';
    make them variables, like this:
    $message = 'Thanks for contacting us. We\'ll be in touch soon!';
      } else {
    $message = 'Sorry an error occurred. Please try again later.';
    Then, in the location where you want the message to appear. . .
    <?php echo $message ?>

  • I requested a repair, but there was an error after clicking the button with my credit card info. I was still charged, but the form email I received the next day had incorrect info about my iPod Touch problem. How can I contact CS w/o paying $19?!

    My iPod Touch battery is not working. I requested a repair through the Apple Support. On the final page, when I clicked the button that puts the info through with your credit card number, the resulting page gave an error (I wish I'd have saved it!). Anyhow, I checked my credit card and it was charged, so I assumed the repair request went through. The next day I received a form email saying my problem was with "Sync with iTunes (Not iCloud) - Data Backup/Migration (not iCloud)" instead of the battery repair. It also says for iPod customers, to send your iPod to Apple - but I had requested the "iPod Coffin" to be mailed to me so I could send it back. Obviously there was an error between the request and what was received, so I'd like to ask Customer Service about it. However, I can't find a way to contact them. When I replied to that form email, I recieved an automated reply saying emails there were not read. Anything online asks me to pay $19 and I don't have the correct issues to request an exception. The closest store is over an hour away or I'd simply go there to ask. What can I do?! Any suggestions you have are much appreciated. Thank you!
    PS - The form email also says if I wait 10 days the repair request will be canceled. Does this mean my credit card will be refunded for the $85 battery replacement charge if it is canceled automatically?

    Thanks, but I've been on the phone with AppleCare US (where I am and live) and AppleCare UK. They continue bouncing me back and forth without helping resolve the problem.
    Perhaps someones knows how to further escalate the issue at Apple?

  • DW CS5, Sending contact form results to email with page redirection using php script

    I am currently building a site from scratch with Dreamweaver, with the intent of replacing my current website layout that was designed using Intuit's website builder. My dreamweaver site is not online, but i have setup a local test server on my computer, using XAMPP, and i have an apache server with a MySQL database and a mercury mailserver running. I mention that in case it makes a difference in your answers. If necessary, I can include those settings, but that may be asking too much.
    I have an html contact form for users to schedule service appointments. I need the resulting actioned php file to do the following after submit is clicked: verify certain fields have been entered; prevent spammers or verify human visitors; send the form results to a (hidden from public view of any kind) email address; redirect user to a confirmation page, or an error page.
    I found the following code but being less than a newbie im not sure what needs to be changed, or if its even the right script i should be using:
    5 <?php
    6 $email = $_POST['email'];
    7 $mailto = '[email protected]';
    8 $mailsubj = 'You Have a Service Request';
    9 $url = '/MyLandingPage.html';
    10 $req = '0';
    11 $mailbody = "Results from form:\r\n";
    12 $space = ' ';
    13 $line = '
    14 ';
    15 foreach ($_POST as $key => $value)
    16 {
    17 if ($req == '1')
    18 {
    19 if ($value == '')
    20 {echo "$key is empty";die;}
    21 }
    22 $j = strlen($key);
    23 if ($j >= 20)
    24 {echo "Name of form element $key cannot be longer than 20 characters";die;}
    25 $j = 20 - $j;
    26 for ($i = 1; $i <= $j; $i++)
    27 {$space .= ' ';}
    28 $value = str_replace('\r\n', "$line", $value);
    29 $conc = "{$key}:$space{$value}$line";
    30 $text .= $conc;
    31 $space = ' ';
    32 }
    33 mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
    34 echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    35 ?>
    Can anyone please illuminate me on what I need?
    Thank You in advance

    Take a read here, this might enlighten you a little.
    http://www.paulgdesigns.com/learncontactform.php
    You are doing this with your local testing server, is it set up to email?
    Gary

  • How can I make my Contact Form send info to my email?

    Greetings! I have below a contact form that i have creaed with some help but I can't seem to make it send the information to my email address after it is submitted. That is my most important issue right now.
    A secondary issue is, can I make it so once this form is submitted it send the info to my email without doing a page redirect?
    Thanks in advance!

    Ok what about this code located at www.ybcreations.com/ContactTest.php?
    <?php
    // Set email variables
    $email_to = '[email protected]';
    $email_subject = 'BestMarketingNames Inquiry';
    // Set required fields
    $required_fields = array('fullname','email','comment');
    // set error messages
    $error_messages = array(
              'fullname' => 'Please enter a Name to proceed.',
              'email' => 'Please enter a valid Email Address to continue.',
              'comment' => 'Please enter your Message to continue.'
    // Set form status
    $form_complete = FALSE;
    // configure validation array
    $validation = array();
    // check form submittal
    if(!empty($_POST)) {
              // Sanitise POST array
              foreach($_POST as $key => $value) $_POST[$key] = remove_email_injection(trim($value));
              // Loop into required fields and make sure they match our needs
              foreach($required_fields as $field) {
                        // the field has been submitted?
                        if(!array_key_exists($field, $_POST)) array_push($validation, $field);
                        // check there is information in the field?
                        if($_POST[$field] == '') array_push($validation, $field);
                        // validate the email address supplied
                        if($field == 'email') if(!validate_email_address($_POST[$field])) array_push($validation, $field);
              // basic validation result
              if(count($validation) == 0) {
                        // Prepare our content string
                        $email_content = 'New Website Comment: ' . "\n\n";
                        // simple email content
                        foreach($_POST as $key => $value) {
                                  if($key != 'submit') $email_content .= $key . ': ' . $value . "\n";
                        // if validation passed ok then send the email
                        mail($email_to, $email_subject, $email_content);
                        // Update form switch
                        $form_complete = TRUE;
    function validate_email_address($email = FALSE) {
              return (preg_match('/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $email))? TRUE : FALSE;
    function remove_email_injection($field = FALSE) {
       return (str_ireplace(array("\r", "\n", "%0a", "%0d", "Content-Type:", "bcc:","to:","cc:"), '', $field));
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <!-- Contact Form Designed by James Brand @ dreamweavertutorial.co.uk -->
    <!-- Covered under creative commons license - http://dreamweavertutorial.co.uk/permissions/contact-form-permissions.htm -->
              <title>Contact Form</title>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              <link href="Billy testing/ContactForm.css" rel="stylesheet" type="text/css" />
              <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
        <script type="text/javascript" src="Billy testing/validation/validation.js"></script>
              <script type="text/javascript">
    var nameError = '<?php echo $error_messages['fullname']; ?>';
                        var emailError = '<?php echo $error_messages['email']; ?>';
                        var commentError = '<?php echo $error_messages['comment']; ?>';
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
        </script>
    </head>
    <body onload="MM_preloadImages('Billy testing/x.png')">
    <div id="formWrap">
    <h2>We appreciate your business</h2>
    <div id="form">
    <?php if($form_complete === FALSE): ?>
    <form action="ContactTest.php" method="post" id="comments_form">
              <div class="row">
              <div class="label">Your Name</div> <!--end .label -->
              <div class="input">
              <input type="text" id="fullname" class="detail" name="fullname" value="<?php echo isset($_POST['fullname'])? $_POST['fullname'] : ''; ?>"/><?php if(in_array('fullname', $validation)): ?><span class="error"><?php echo $error_messages['fullname']; ?></span><?php endif; ?>
              </div><!-- end. input --><!-- end .context -->
              </div><!-- end .row -->
        <div class="row">
              <div class="label">Your Email Address</div> <!--end .label -->
              <div class="input">
              <input type="text" id="email" class="detail" name="email" value="<?php echo isset($_POST['email'])? $_POST['email'] : ''; ?>"/><?php if(in_array('email', $validation)): ?><span class="error"><?php echo $error_messages['email']; ?></span><?php endif; ?>
              </div><!-- end. input --><!-- end .context -->
              </div><!-- end .row -->
        <div class="row">
              <div class="label">Comments</div> <!--end .label -->
              <div class="input">
              <textarea id="comment" name="comment" class="mess"><?php echo isset($_POST['comment'])? $_POST['comment'] : ''; ?></textarea><?php if(in_array('comment', $validation)): ?><span class="error"><?php echo $error_messages['comment']; ?></span><?php endif; ?>
              </div><!-- end. input -->
              </div><!-- end .row -->
        <div class="submit">
        <input type="submit" id="submit" name="submit" value="Send Message" />
        </div><!-- end .submit-->
        </form>
         <?php else: ?>
    <p style="font-size:25px; font-family:Arial, Helvetica, sans-serif; color:#255E67; margin-left:25px;">Thank you for your Message!</p>
    <script type="text/javascript">
    setTimeout('ourRedirect()', 5000)
    funtion ourRedirect(){
              location.href='contact.html'
    </script>
    <?php endif; ?>
    </div><!-- end #form-->
    </div>
    <p> </p>
    <!-- end formwrap -->
    </body>
    </html>

  • How can I create a contact form for sending emails in SharePoint Online?

    Dear Forum members,
    I´ve got a question about creating a custom contact form to send emails for a public site in SharePoint online.
    Could someone help us with some advise?
    In advance, thank you very much.
    Kind regards,
    Frits

    You can create Custom list and make alerts enable to send emails as soon as contact created.
    Bala

  • Emails generated by the Contact Form widgets are saying they are coming from me rather than the person who has generated the email?

    Can I change the emails generated by the Contact Forms from saying that they are coming from me, to the address of the person that's actually generated the enquiry on the contact form? Or does this always automatically link back to my Creative Cloud account because thats how I'm hosting the websites?

    Because they ARE coming from you (at least from your account)... this is the account the website is using to send the form to your email and this means that a user visiting your website can send you this email "EVEN" when they don't own an email account themselves.
    No you can't legialy change the address to theirs... thats a big no no in most countrys but you can and should have a "contacts" field on your form that allows people to give you a email or phone number so that you can follow up.
    p.s. many people make the mistake of trying to force email contacts in their forms and that offen turns people off using them if they MUST tell you the colour of their underware just to contact you about a sales offer or simple question then don't expect to get much feed-back from your forms.

Maybe you are looking for