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>

Similar Messages

  • How can I make a detailed form widget into TWO columns?

    how can I make a detailed form widget into TWO columns? I have a contact form with a lot of fields.

    Hi Whatsmyjam9999,
    You can place a blank composition widget then click tigger 1, click inside target 1 and from menu--> files--> place the image and adjust it's dimensions, you can repeat the same steps for trigger 2 and 3
    Here is a video link http://ghai2.worldsecuresystems.com/jing/2013-07-22_1442.swf

  • How can I make my contacts & messages private/confidential?

    How can I make my contacts and messages private?

    I don't think you can passcode protect your contacts. Have you thought of giving the numbers a false name/heading? Maybe something like Wal-Mart or pizza take out (or other nonsensical names having nothing to do with the actual contact)? If you want the numbers hidden regardless, I doubt that it's possible.
    EDIT
    Another idea is to have multiple contact sets and restore the set you want to use/have on your phone at any one time. There are contact backup apps to do this...one I use is called My Contacts Backup (free) which backs up your contacts to a file which you then email to yourself. Make multiple backups and then restore the set (after first deleting the previous set using the "delete contacts" option within the app) you wish to have on your phone. Restoring contacts involves tapping on the contact backup file (in VCard or CSV format) which will then restore them on the device.
    Have you tried one of the apps that may help? Search the AppStore for "private contacts"...there seem to be a few free ones out there.

  • How can i make an action to send photos via email?

    hi
    under windows xp
    how can i make an action to send photos via email?
    i know there is a Export Actions
    i tried to copy a link of "C:\Programs\Outlook Express\msimn.exe"
    but lightroom export the file & open the client , but doesn't open the dialog to send email
    how can i do it?

    For Outlook Express use MAPIMailer from
    Lightroom Extra at Downloads/Other Goodies/MAPIMailer
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core running 10.4.10 & Win XP, Pentax *ist D
    http://donricklin.blogspot.com/

  • My husband and I each have iphones, how can we share the contact and calender info we have have in our iclouds with each other?

    My husband and I each have an iphone 4S, how can we share the contact and calender info we have in our iclouds with each other?

    You can make one or more calendars of one iphone sharable and the other user will be able to have those sharable calanders synced.  Unfortunately, you can't do that with contacts.  But you could go to the computer account used by you or your husband, perform a backup of the contacts (see the file menu), copy the file to the other account used to sync the other iphone, and restore.  It's a manual process that has to be performed periodically, but doable.
    The other method is for each of you to use the same iCloud ID and have both iphones synced to be identical.  But I don't recommend that otherwise you'll each get the same text messages and who knows what else.

  • How can I make my tags applied to BOTH of my email accounts?

    My first email account was with comcast.net; I generated a number of tags and all are applied to incoming messages as desired. I later added my gmail.com account and none of the tags are applied to any of the incoming mail.
    How can I make the tags work for BOTH accounts?
    Thanks in advance.

    Read the user manual that came with your camera or contact the vendor.  My camera asks me where I want my uploads to go to.  There is a setting in its option menu.  Desktop is the default upload feature that my camera has.
    When I connect the memory card to a reader, the photos automatically upload to my desktop.

  • How can I prevent personal contacts from syncing with Exchange corporate email?

    I have my phone synching with my work Exchange server over ActiveSync, and have 2 personal email accounts (POP and IMAP).  The 2 personal accounts are also configured in Outlook 2010 on my home computer.  Itunes is also installed on this computer. 
    I want my contacts from my 2 personal accounts to sync to my phone (which is working), but not have them sync to my work account (this part is not working the way I want).  I now have all my personal contacts uploaded to my work account.  How can I remove the contacts from my work account without removing them from my phone?

    Unless you are in the same household, the agreement for Mountain Lion does not allow the setup you have now.
    You need to spend another US$30 and buy an additional copy and get that other MacBook on its own unique Apple_ID.

  • 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

  • How can I make my contact us page a downloadable PDF

    Sorry for what may be a simple task but I am not sure how to create a pdf of my contact page at http://glasgow-dentists.co.uk/contact-us/
    I would like patients to be able to download and print the page as I will be adding directions.
    Also I am considering putting in an email function so they can email themselves or someone else the pdf.
    Would be great if it could remain clickable somehow for the map.
    Appreciate any quick pointers to where I could learn how to do this.
    Also if there is a specific reader/software I need please let me know.
    I am using Windows 7
    thanks,
    Colin

    Are you wanting the form in a PDF format, or just create a PDF of the directions to your business in PDF form and post that. Assuming the latter, you just create your document in any editor, word processor, or layout program and print it to a PDF. Then simply put up the PDF and add a link to it. If you want the form information you get into other issues due to some license restrictions on forms. You can create a form that can be printed and the data sent to you with no problem. The form data (FDF file) can be imported into the form and printed for your use, or added to a database. If you create a PDF of the web page (probably should work directly with the section of the page rather than the whole screen), you can then add the form fields to that PDF (I tried and the automated adding did not work, but your form is simple and manual addition is simple). Add a button for the submit button and send the FDF file to your web site (or e-mail if you prefer with mailto:<address>, but be aware that the e-mail does not always work for clients and is also not secure). If you select the PDF file submission you get into requirements for Reader Rights and the license restrictions (I am not sure how much this has changes in AA XI -- you would have to read the license agreement -- but it would not be acceptable in a business under previous versions).

  • How Can I Create A Contact Form In Dreamweaver Using ASP

    I tried to create a contact form using php, but that failed epically. The server doesn't support php, and there isn't anything I can do about that. My only option now is to create it using ASP but I can't find a good tutorial on how to do so. Please help me!

    Ask your host if they have a form-to-email script you can use.  Many commercial hosts have scripts on their servers which you can activate through your C- or Admin-panel.
    Failing that, there are some commercial products you can use.
    Forms to Go ~
    http://www.bebosoft.com/products/formstogo/overview
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Can I make a 'Contact Form' in Fireworks CS4?

    I would like to inbed a simple 'Contact Form' into one of the
    webpages that I am creating in Fireworks CS4 so that people could
    type a message, and then it would go straight to my email.
    Any help that you could provide will be appreciated!
    Thank You!

    You wouldn't do this is FW. It's strictly an HTML thing - use
    DW.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "gumbogood" <[email protected]> wrote in
    message
    news:gl5ibj$h5i$[email protected]..
    >I would like to inbed a simple 'Contact Form' into one of
    the webpages that
    >I
    > am creating in Fireworks CS4 so that people could type a
    message, and then
    > it
    > would go straight to my email.
    >
    > Any help that you could provide will be appreciated!
    >
    > Thank You!
    >

  • How can I print out contact list showing info for contacts?

    How can i print out my contact list showing info. (phone #, email address, etc.)

    Go to my web site at https://sites.google.com/site/ipdparse to download macro and view documentation. IPD Parse runs on Windows and Excel. It produces reports for several DBs including Address Book (contacts). My contact information is on my website. Let me know if you have questions or comments. All my services are free.

  • On a website clicking on highlighted text in blue, the browser should take you to info on that subject. My Firefox opens a blank page and says "search history and bookmarks." How can I make it go to the info highlighted in blue text? Ver 3.6.15

    Usually the browser will take the user to info pages when a click on blue text is done. My browser just opens a blank page and has "search history and bookmarks and then just sits there. I can change that so it will do nothing and the message is "type a web address". It used to work fine. How can I fix this.

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • How can I make the current date/time be sent when emailing as XML?

    I'm creating a form for a customer to use for submitting print jobs. This customer will be emailing the XML form data, which will in turn be converted into a production order. I'd like to make the PDF form capture my customer's system time, so that I know when they filled out the form. I COULD just leave that up up the customer and use required current date and time fields, but that provides the ability for the customer to falsify that information.
    Is there any good way to capture the current date/time in the XML data, so that the customer doesn't need to nor has the ability to?
    Any suggestions would be great!

    You can use the following methods getHours(),getMinutes(), and getSeconds() from the date object to obtain the values for hour,minute,and second.
    Click here to see an example:
    http://66.34.186.88/LiveCycleSamples/.3bbc2f4b.pdf

  • How can I make my own form without a wizard

    Hello,
    I already created Tabular Forms using the wizard and everything worked. But now I have different requirements on my from. I need some radio buttons and some option buttons (which values come from different tables) and some normal number fields. So I can't no longer use the tabular forms.
    I created a table which can save all the information I want to provide by the form. This table has a primary key populated by a sequence I created too. Then I created a page which looks like a questionnaire I got before to design this form.
    I added another hidden item (*ID*), which should be filled by my sequence and a button which should do the insert statement.
    But I couldn't find out how to do. I looked a the processes which a made when I use the wizard but I'm not sure what they do actually.
    My question is, how is it possible to have the hidden item filled with the next primary key of my table and then how do put all the item values of the form in an insert statement? I there maybe a better way to acchieve my goals?
    Regards
    Felix

    If you created your sequence with a trigger (usually APEX creates these together for you) then there is no need to have the next ID number, when you do your insert it will automatically fill this in for you. The trigger will see that you're trying to insert null for the ID and instead replace it with the next number in the sequence.
    As for having all your items in an insert statement, you can do this in two ways. One being to create up a DML page process to handle the insert/update/delete statements. You will also need an on load row fetch process to load data onto your form. Make sure your page items are set to Source Type Database Column with the column names in the Source Value field.
    The other option is to create custom page processes to do these for you - for example, one process for inserting, one for updating, one for deleting, one for displaying data, and then you can set the condition of each process to only run if a certain button is clicked. This is useful if you have more code to run with each button click.

Maybe you are looking for

  • W-lan problems imac

    Hi, my iMac (27", mid2011) is permanently loosing the w-lan conection. The Symbol says the conection is good but with Safari or Chrome I cant't open a site frome the net. I hope this problem will be solved soon!

  • Query Caching not working after migrating to ver12 for DateTime columns

    I have an applet that charts production numbers over time.  The query template is cached for 1 min.  When the applet uses fresh data the applet charts properly and the underlying data has accurate values in the date/time columns.  But if the applet c

  • SQL LDR Control file date format

    Hi All I need to Insert date with time using sqlldr. In my data file am getting date value as 20110103 10:27:44. In control file am doing like this creation_date "decode(:creation_date, 'null', null, 0,null,to_date(:creation_date, 'YYYYMMDD HH24:MI:S

  • Typing in pdf forms

    How can I type in a pdf form that was sent to me as an e-mail and saved in my documents

  • Why can't I run these news videos please?

    I'm having trouble opening video content on the following site: http://www.yorkshirepost.co.uk/video/Superstar-Dolly-aims-to-be.3559363.jp error message says something about not being able to find plug-in and MIME. I've tried through Firefox and also