PHP Form Mail Scripts

What is a good resource for pre-made PHP Form Mailer Scripts.
This is for use with a website hosted on GoDaddy.
My client has a few requirements that the GoDaddy script does
not offer (and the script I chose from GoDaddy is uneditable). I
know nothing about scripting but thought I could use a pre-made
script and modify it...is that crazy thinking on my part?
Here are the special requests from my client:
- They'd like to see the time the form was submitted in EST
(the GoDaddy script puts the time in military time in another time
zone in the subject line). Can this appear in the body of the email
as well as the subject line?
- They'd like the form to be sent to the person submitting it
as well as to their company
- They would like to be able to REPLY TO the email they
receive with the form submission and have it be addressed to the
person submitting the form. The current script has the email
addressed to themselves (the company) if they click REPLY TO, so
they are replying to themselves
- Although this has nothing to do with the Form Mailer script
as far as I can guess, they asked that the person filling out the
form be able to print it prior to submitting (in my opinion,
though, if i can have a copy of the submission sent to the
submitter, there's no reason for this). But if anyone knows how to
do this, please let me know.
- Finally, the client wants to know if each submission can
have a unique tracking number assigned to it.
Thank you all. Any feedback is appreciated.
Richard

Hi,
I can without any doubt recommend Forms 2 Go:
http://www.bebosoft.com/products/formstogo/index.php
Very easy to use and even someone like me who don't know a
lot of
programming, use it extensively.
Deon
"RichyZee" <[email protected]> wrote in
news:gcvkac$fcp$[email protected]:
> What is a good resource for pre-made PHP Form Mailer
Scripts. This is
> for use with a website hosted on GoDaddy.
>
> My client has a few requirements that the GoDaddy script
does not
> offer (and
> the script I chose from GoDaddy is uneditable). I know
nothing about
> scripting but thought I could use a pre-made script and
modify it...is
> that crazy thinking on my part?
>
> Here are the special requests from my client:
>
> - They'd like to see the time the form was submitted in
EST (the
> GoDaddy
> script puts the time in military time in another time
zone in the
> subject line). Can this appear in the body of the email
as well as the
> subject line?
>
> - They'd like the form to be sent to the person
submitting it as well
> as to
> their company
>
> - They would like to be able to REPLY TO the email they
receive with
> the form
> submission and have it be addressed to the person
submitting the form.
> The current script has the email addressed to themselves
(the company)
> if they click REPLY TO, so they are replying to
themselves
>
> - Although this has nothing to do with the Form Mailer
script as far
> as I can
> guess, they asked that the person filling out the form
be able to
> print it prior to submitting (in my opinion, though, if
i can have a
> copy of the submission sent to the submitter, there's no
reason for
> this). But if anyone knows how to do this, please let me
know.
>
> - Finally, the client wants to know if each submission
can have a
> unique
> tracking number assigned to it.
>
> Thank you all. Any feedback is appreciated.
>
> Richard
>
>

Similar Messages

  • Php form processing script

    Hi. I got a program to write a php form processing script. My submit form is for photo submission to my domain email. I published to site and did a test to see if it works i got this error:
    Warning: require_once(F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php): failed to open stream: No such file or directory in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24 Fatal error: require_once(): Failed opening required 'F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php' (include_path='.;C:\php\pear') in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24
    What does this mean? How can i solve this so that i can process my form?

    See if the below form helps: You need to create a folder on your server named - upload - this is where any files uploaded will be stored (make sure the folder is writable. Also change the email address where the information that someone who has uploaded a file will go to. Look for the following in the code: $to ="XXXXXXXXXXXX.com";
    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    #wrapper {
    width: 400px;
    margin: 0 auto;
    </style>
    </head>
    <body>
    <div id="wrapper">
    <?php if(isset($_POST['submit'])) {
    $name = trim($_POST['name']);
    if(empty($name)) {
    $error['name'] = "Please provide your name";
    $location = trim($_POST['location']);
    if(empty($location)) {
    $error['location'] = "Please provide your location";
    $email = trim($_POST['email']);
    if(empty($email)) {
    $error['email'] = "Please provide your email";
    $category_description = trim($_POST['category_description']);
    if(empty($category_description)) {
    $error['category_description'] = "Please provide the category or description";
    $terms_conditions = trim($_POST['terms_conditions']);
    if(empty($terms_conditions)) {
    $error['terms_conditions'] = "Please accept the terms & conditions";
    $allowedExts = array(
       "doc",
      "docx",
            "rtf",
            "txt",
            "pdf",
            "jpeg",
            "jpg",
    $allowedMimeTypes = array(
      'application/msword',
            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'application/rtf',
            'application/x-rtf',
            'text/richtext',
            'text/rtf',
            'application/plain',
      'application/pdf',
      'image/gif',
      'image/jpeg',
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if (empty($_FILES["file"]["name"])) {
        $selectFile = 'Please select a file to upload';
    elseif ( ! ( in_array($extension, $allowedExts ) ) ) {
      $fileTypeNotAllowed = 'File type not allowed';
    elseif ($_FILES["file"]["size"] > 2097152) {
      $fileTooLarge = 'Please provide a smaller file';
    elseif (file_exists("upload/" . $_FILES["file"]["name"])) {
    $fileExists = $_FILES["file"]["name"] . " already exists, Please change the file name ";
    elseif (in_array( $_FILES["file"]["type"], $allowedMimeTypes ) )
        if(!empty($_POST['terms_conditions'])) {
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
        $fileName = $_FILES["file"]["name"];
        $fileUploadSuccessful = 'File uploaded successfully';
    $to = "XXXXXXXXXXXXX.com";
    $subject   = "Upload to website";
    $headers  = "From: $email\r\n";
    $headers .= "Reply-To: $email\r\n";
    $message = "Name: $name\n\n";
    $message .= "Location: $location\n\n";
    $message .= "Email Address: $email\n\n";
    $message .= "Category/Description: $category_description\n\n";
    $message .= "File: $fileName\n\n";
    mail($to, $subject, $message, $headers);
    $sent = "Mail was sent successfully";
    ?>
    <h1>Form</h1>
    <?php
    foreach ($error as $value) {
        echo "<p>".$value."</p>";
    if(isset($formFieldError)) {
    echo "<p>".$formFieldError."</p>";
    if(isset($selectFile)) {
    echo "<p>".$selectFile."</p>";
    if(isset($fileTypeNotAllowed)) {
    echo "<p>".$fileTypeNotAllowed."</p>";
    if(isset($fileTooLarge)) {
    echo "<p>".$fileTooLarge."</p>";
    if(isset($fileExists)) {
    echo "<p>".$fileExists."</p>";
    if(isset($fileUploadSuccessful)) {
    echo "<p>".$fileUploadSuccessful."</p>";
    ?>
    <form action="upload_file.php" method="post"
    enctype="multipart/form-data">
    <p>
    <label for="name">Name<br>
    <input type="text" name="name" id="name" value="<?php if(isset($name)) {echo $name; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="location">Location<br>
    <input type="text" name="location" id="location" value="<?php if(isset($location)) {echo $location; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="email">Email<br>
    <input type="text" name="email" id="email" value="<?php if(isset($email)) {echo $email; }  ?>" />
    </label>
    </p>
    <p>
    <label for="category_description">Category and Description<br>
    <input type="text" name="category_description" id="category_description" value="<?php if(isset($category_description)) {echo $category_description; }  ?>" />
    </label>
    </p>
    <p>
    <label for="file">File Attachment:<br>
    <input type="file" name="file" id="file" />
    </label>
    </p>
    <p>
    <label for="terms_conditions">Terms & Conditions:
    <input name="terms_conditions" type="checkbox" value="accept" <?php if(isset($_POST['terms_conditions'])) {echo "checked"; }  ?>> (Please check)
    </label>
    </p>
    <input type="submit" name="submit" value="Submit" />
    </form>
    </div>
    </body>
    </html>

  • Php form data script

    Hi all
    would someone beable to help?
    I have been using a free php form data script on my website but I am finding that when people fill in the form that not all the form submissions are getting through and I am not sure if it is the php form script
    Would any one be to direct me to a good free php data script that is simple to use
    many thanks for your help!

    hi there
    many thanks for your help!
    ok, am  little new to this, so do you mean in my contact.php script I have?
    not sure what I would be looking for?
    I tried to attach to this post but copuld so zipped it for download here; http://www.thevineproject.org.uk/contact.zip
    thanks for your help

  • PHP Form mail

    I used this script
    http://www.visibilityinherit.com/code/php-form-validation.php
    to produce a form and everything worked fine on my site, which I
    was using for testing. When I transferred over to the client's site
    it doesn't send the email. The error and thank you messages work,
    but no email. As I have heard that some hosts block some php files
    with the name 'formmail' I called it something else.
    I have checked and rechecked all the data and only my email
    address and the URLs for the error and thank you pages had to be
    changed, my email is correct, but still not email.
    Any ideas as to what is happening and how I can get around it
    please?
    Rosalind

    I have been sent the following information and code, but have
    not succeeded in working out where to add it. The code I am using
    is underneath. Many thanks
    - to send emails through our servers you must comply with one
    of the following rules
    a. The sending email must be from your domain
    b. The receiving email must be from your domain
    This account could/should be [email protected]
    - To avoid a wrong use of our scripts by spammers you must
    had a line before you call the “mail” functionality
    ini_set("sendmail_from", " [email protected] ");
    - Please add to the email send code a functionality
    “-f” in the fifth parameter of the function send mail
    - This is the simple configuration of sending emails in php
    <?php
    ini_set("sendmail_from", [email protected]);
    mail($email_to, $email_subject, $email_message, $headers,
    '-f'[email protected]);
    ?>
    my php code is
    <?php
    // Input Your Personal Information Here
    $mailto = '[email protected]' ;
    $from = "FormosaParadise.com" ;
    $formurl = "
    http://formosaparadise.com/correios.php"
    $errorurl = "
    http://formosaparadise.com/formmailerror.php"
    $thankyouurl = "
    http://formosaparadise.com/thankyou.php"
    // End Edit
    // prevent browser cache
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "
    GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    function remove_headers($string) {
    $headers = array(
    "/to\:/i",
    "/from\:/i",
    "/bcc\:/i",
    "/cc\:/i",
    "/Content\-Transfer\-Encoding\:/i",
    "/Content\-Type\:/i",
    "/Mime\-Version\:/i"
    if (preg_replace($headers, '', $string) == $string) {
    return $string;
    } else {
    die('You think Im spammy? Spammy how? Spammy like a clown,
    spammy?');
    $uself = 0;
    $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" :
    "\n" ;
    if (!isset($_POST['email'])) {
    header( "Location: $errorurl" );
    exit ;
    // Input Your Personal Information Here
    $name = remove_headers($_POST['name']);
    $email = remove_headers($_POST['email']);
    $phone = remove_headers($_POST['phone']);
    $comments = remove_headers($_POST['comments']);
    $http_referrer = getenv( "HTTP_REFERER" );
    // End Edit
    if
    (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email))
    header( "Location: $errorurl" );
    exit ;
    // Input Your Personal Information Here
    if (empty($name) || empty($email) || empty($phone)
    ||empty($comments)) {
    header( "Location: $errorurl" );
    exit ;
    // End Edit
    if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
    header( "Location: $errorurl" );
    exit ;
    if (get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
    // sets max amount of characters in comments area (edit as
    nesesary)
    if (strlen($comments) > 1250) {
    $comments=substr($comments, 0, 1250).'...';
    // End Edit
    $message =
    "This message was sent from:\n" .
    "$http_referrer\n\n" .
    // Input Your Personal Information Here
    "Name: $name\n\n" .
    "Email: $email\n\n" .
    "Phone No: $phone\n\n" .
    "Comments: $comments\n\n" .
    "\n\n------------------------------------------------------------\n"
    // End Edit
    mail($mailto, $from, $message,
    "From: \"$name\" <$email>" . $headersep . "Reply-To:
    \"$name\" <$email>" . $headersep );
    header( "Location: $thankyouurl" );
    exit ;
    ?>

  • Php form mailer/Flash help

    I have a php form that I am using with my Flash file. It
    works great so far, but I would like to get confirmation from the
    php in the Flash file, that the info has really been sent. I think
    it is already sent up in the php, but I don't know how to handle it
    in my Flash file. The php file is attached. Do I use the echo? How
    would I do that? What I want, is in my Flash file to say sending,
    until I get then feedback from the php, and then say, sent
    successfully.
    Thanks a lot for any help!

    It is all inside an ifStatment that is inside a function,
    which gets called by the button that send the form. Here is the
    full thing.
    function validateForm(tName:String, tEmail:String,
    tSubject:String, tMsg:String):Void {
    trace("validateForm was called");
    if (tName == "" || tName == undefined) {
    trace("tName if");
    this.showAlertMsg("Please enter your name");
    } else if (tEmail == "" || tEmail == undefined ||
    tEmail.indexOf("@") == -1 || tEmail.indexOf(".") == -1) {
    trace("Invalid email address: "+tEmail+" infexOf1:
    "+tEmail.indexOf("@")+" indexOf2: "+tEmail.indexOf("."));
    this.showAlertMsg("Invalid email address");
    } else if (tSubject == "" || tSubject == undefined) {
    trace("tSubject if");
    this.showAlertMsg("Please enter a subject");
    } else if (tMsg == "" || tMsg == undefined) {
    trace("tComments if");
    this.showAlertMsg("Please enter some comments");
    } else {
    trace("the else was called...");
    var send_lv = new LoadVars();
    //send_lv.onLoad = ShowStatus;
    //send_lv.EmailType = "Quote";
    send_lv.Name = tName;
    send_lv.FromEmail = tEmail;
    send_lv.Subject = tSubject;
    send_lv.Comments = tMsg;
    send_lv.status = "";
    send_lv.sendAndLoad("php/sendContact.php",result_lv,"Post");
    this.showAlertMsg("Sending...");
    var submitListener:Object = new Object();
    submitListener.click = function(evt:Object) {
    var result_lv:LoadVars = new LoadVars();
    result_lv.onLoad = function(success:Boolean) {
    if (success) {
    this.tf_showAlertMsg.text = "Thank you for sending us an
    email";
    } else {
    this.tf_showAlertMsg.text = "Email did not go through";
    function showAlertMsg(msg:String):Void {
    this.tf_showAlertMsg.text = "";
    this.tf_showAlertMsg.text = msg;
    this.send_btn.onRelease = function() {
    validateForm(tf_Name,tf_Email,tf_Subject,tf_Comments);
    I tried the new way Dave posted and it still does not get the
    echo from the form.
    Thanks so much to both of you for the help!

  • Php form mailer help

    I have this form that I got to work with my flash file. There
    is part of the php that should send an acknowledgement email and it
    seems to be not working. I am wondering if someone could explain
    what I am missing.
    I think I have everything working down to line 16. After
    that, I think I understand what is going on, but might be missing
    some things.
    How can I use the echo and &Status to make sure in my
    Flash file that the form actually got send?
    Thanks a lot for any help!

    It is all inside an ifStatment that is inside a function,
    which gets called by the button that send the form. Here is the
    full thing.
    function validateForm(tName:String, tEmail:String,
    tSubject:String, tMsg:String):Void {
    trace("validateForm was called");
    if (tName == "" || tName == undefined) {
    trace("tName if");
    this.showAlertMsg("Please enter your name");
    } else if (tEmail == "" || tEmail == undefined ||
    tEmail.indexOf("@") == -1 || tEmail.indexOf(".") == -1) {
    trace("Invalid email address: "+tEmail+" infexOf1:
    "+tEmail.indexOf("@")+" indexOf2: "+tEmail.indexOf("."));
    this.showAlertMsg("Invalid email address");
    } else if (tSubject == "" || tSubject == undefined) {
    trace("tSubject if");
    this.showAlertMsg("Please enter a subject");
    } else if (tMsg == "" || tMsg == undefined) {
    trace("tComments if");
    this.showAlertMsg("Please enter some comments");
    } else {
    trace("the else was called...");
    var send_lv = new LoadVars();
    //send_lv.onLoad = ShowStatus;
    //send_lv.EmailType = "Quote";
    send_lv.Name = tName;
    send_lv.FromEmail = tEmail;
    send_lv.Subject = tSubject;
    send_lv.Comments = tMsg;
    send_lv.status = "";
    send_lv.sendAndLoad("php/sendContact.php",result_lv,"Post");
    this.showAlertMsg("Sending...");
    var submitListener:Object = new Object();
    submitListener.click = function(evt:Object) {
    var result_lv:LoadVars = new LoadVars();
    result_lv.onLoad = function(success:Boolean) {
    if (success) {
    this.tf_showAlertMsg.text = "Thank you for sending us an
    email";
    } else {
    this.tf_showAlertMsg.text = "Email did not go through";
    function showAlertMsg(msg:String):Void {
    this.tf_showAlertMsg.text = "";
    this.tf_showAlertMsg.text = msg;
    this.send_btn.onRelease = function() {
    validateForm(tf_Name,tf_Email,tf_Subject,tf_Comments);
    I tried the new way Dave posted and it still does not get the
    echo from the form.
    Thanks so much to both of you for the help!

  • PHP forms & required fields

    i'm creating an inquiry form for a client hosting w/godaddy.
    Site is in DW using godaddy's php form mail script. script
    works fine for sending formmail.
    Is it possible to validate form fields in php? the customer
    wants to have the first name, email address, etc. being a required
    field or the form will not submit. godaddy support is clueless,
    they e-mailed a kb article on changing the form e-mail address as a
    solution.
    can anyone provide insight? thanx in advance!

    Sure it is. It's even possible to do it in javascript before
    the form gets
    submitted.
    Which DW are you using?
    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
    ==================
    "donna_d" <[email protected]> wrote in
    message
    news:fn8468$r4n$[email protected]..
    > i'm creating an inquiry form for a client hosting
    w/godaddy.
    > Site is in DW using godaddy's php form mail script.
    script works fine for
    > sending formmail.
    >
    > Is it possible to validate form fields in php? the
    customer wants to have
    > the
    > first name, email address, etc. being a required field
    or the form will
    > not
    > submit. godaddy support is clueless, they e-mailed a kb
    article on
    > changing
    > the form e-mail address as a solution.
    >
    > can anyone provide insight? thanx in advance!
    >

  • Forms (form-mail) problem

    I've been searching for days on end to try and solve this problem but have to admit defeat.  What I am trying to do is to just get a form on my website to work. I have created the form and now I somehow need to get the info from the form sent to my email address.  I've had a look at various form-mail scripts, but find it hard to understand what to do with them. I've contacted my web hoster, but all I can ascertain from them is that they don't supply a script for this and that when I have one I should upload it into  /public_html/cgi-bin  
    I have decided it would be easier to purchase something which creates the script for my form, but I'm unsure as to what format to get. I have a choice of PHP or Perl (my web hoster provides both)  - Is one better than the other?  If someone could advise me on this I'd really, really appreciate it!

    Okay,
    Well your not going to just magically have this working I would say today. What I would suggest is to invest in a getting started book in PHP. PHP is simple but you must take a step back from what you are doing and just spend a day or two reading some not all of the book to see whats going on. Then write a couple little things from the examples to get a starting grasp on it. I am sure that there are plenty of PHP developers in these Adobe forums that would be glad to assist you with this once you have made some effort into picking up PHP. PHP will allow you do more than just static html pages. Perl I have not done but have heard its more like programming or regular expressions so I would not suggest that you start there. PHP would be an easier path to get started on.
    Buy an intro book
    Get your system setup
    Read along with it as you try and code or just read it then code
    Ask questions

  • Configurable PHP form emailer

    I'm looking suggestions for a drop-in PHP form emailer
    script... something that I can either configure by using templates
    that are unique to each form or some other method of per-form
    configurability.
    I'm using soupermail.pl now, but would like to move away from
    it because it has issues with certain users who use AOL and have
    Norton security products (they will receive errors when submitting
    the form).
    I do not want to write a generic form mailer from scratch, as
    I am not comfortable with ensuring that it is safe from spammers...
    I would like to find something that I can use from several forms on
    my site. I do not need to write anything to a database, just be
    able to email to variable destination email accounts. I do not want
    to be able to upload or send attachments.
    Thanks for any suggestions.

    Hi there - read my article titled, "Validating your forms
    with PHP" - here:
    http://sourtea.com/articles.php
    At the end of the article, I provide the full, free code to
    do what you're
    looking for.
    HTH, take care.
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Web Dev Articles, Photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "JillTW" <[email protected]> wrote in
    message
    news:eeebap$q71$[email protected]..
    > I'm looking suggestions for a drop-in PHP form emailer
    script... something
    > that
    > I can either configure by using templates that are
    unique to each form or
    > some
    > other method of per-form configurability.
    >
    > I'm using soupermail.pl now, but would like to move away
    from it because
    > it
    > has issues with certain users who use AOL and have
    Norton security
    > products
    > (they will receive errors when submitting the form).
    >
    > I do not want to write a generic form mailer from
    scratch, as I am not
    > comfortable with ensuring that it is safe from
    spammers... I would like to
    > find
    > something that I can use from several forms on my site.
    I do not need to
    > write
    > anything to a database, just be able to email to
    variable destination
    > email
    > accounts. I do not want to be able to upload or send
    attachments.
    >
    > Thanks for any suggestions.
    >

  • Form Mail - server scripts

    Howdy all,
    I use DW 2004MX. If this topic has been addressed before, I'm
    sorry. I am trying to make a very simple form mail work on my
    website; name, address, phone # and send. I know for a fact there
    are two types of form scripts on my server, and both are activated.
    One is a CGI (gdform.cgi), and the other is a PHP (gdform.php). My
    server is Godaddy if that matters. I have read many messages about
    form mail, but cannot find out how to MAKE IT ALL WORK. I have been
    looking for a step-by-step answer, but no luck so far. BTW, I am a
    newbie. The manual I have is "aftermarket", and is near useless for
    the form mail stuff. The web address is www.azaleatrail.com
    Any help would be greatly appreciated,
    Thanks,
    MonaLisaWest

    > One is a CGI (gdform.cgi), and the other is a PHP
    > (gdform.php). My server is Godaddy if that matters.
    my suggestion from trying to sort out questions from others
    hosted with go
    daddy- don't bother with either of those scripts.
    I assume that you can use php files within your site?
    If yes- i suggest this script:
    http://boaddrink.com
    -->phpformmail
    the instructions are in the zipped folder.
    short list of instructions i suggest (use your own info of
    course)
    http://groups-beta.google.com/group/macromedia.dreamweaver/search?q=alan+php
    formmail+edit+recipient&start=0&scoring=d&
    1)go to
    http://boaddrink.com
    -->phpformmail
    download it.
    http://www.boaddrink.com/projects/files/phpformmail/phpformmail_class...
    .2.zip
    extract the ZIP file.
    2) open formmail.php in dreamweaver
    Make the following changes (in code view, turn line numbers
    on)
    2a)
    line 4,
    define('CHECK_REFERER', true);
    change to:
    define('CHECK_REFERER', false);
    reason: too many people use a firewall or Norton security to
    restrict this.
    2b)
    Line 43
    $referers = array('www.example.com', 'example.com');
    change to the url address of your web site.
    reason: this probably isn't needed since we just turned the
    referrer
    checking off. but change it anyway.
    2c) *********this is the hard-coding of the recipient address
    into the php
    file, where it is totally invisble**********
    Line 46
    $recipient_array = array();
    change to:
    $recipient_array = array('me' =>
    '[email protected]);
    **put YOUR email address in to replace
    [email protected]
    reason: this sets the email address the form results will be
    sent to.
    3) now do a File-->Save As and save this file to within
    this Local Site
    folder.
    4) in dw's File Panel, find formmail.php and upload it to the
    remote site.
    5) Now open your form html file in dreamweaver,
    5a)click the mouse into the form area, and select the
    <form> tag on the
    lower left margin of the design window.
    In the Property Inspectory, it should now show the properties
    of the <form>
    tag. In the Property Inspector, to the right of the ACTION
    line, click the
    folder icon and browse to and select the copy of the
    formmail.php file
    you've saved to within this site.
    5b) now go to dw menu-->Insert-->Form
    Objects-->Hidden Field
    This inserts a hidden form field.
    In the property inspector, change the NAME of this field to:
     recipient
    And the VALUE of this field to:  me
    the code should look like:
    <input name="recipient" type="hidden" id="recipient"
    value="me">
    6) Save and upload the form page.
    Try the form from the website.
    Optional:
    make a new page for a thank you for submitting message.
    In the form, insert another hidden field.
    Name:  redirect
    Value:  the full absolute
    http:// address to the new thank you page.
    There is other information about that script in the Docs
    folder.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Php form and mail handling

    I am trying to create a php form and I can get it to spit out the information from the form but I cannot seem to get it to send the result as an email.
    This is probably something really simple and I am totally missing it.
    Here is the form:
    <form method="post" action="sendail.php">               
      <?php
    $ipi = getenv("REMOTE_ADDR");
    $httprefi = getenv ("HTTP_REFERER");
    $httpagenti = getenv ("HTTP_USER_AGENT");
    ?>
      <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
      <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
      <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
            <p>I need:<span class="redStar">*</span>
              <input type= "radio" name = "need" value = "service" />service.
            <input type= "radio" name = "need" value = "sales" />to contact a salesperson.
            <input type= "radio" name = "need" value = "literature" />to have literature sent to me.<br />
            Name:        <input type = "text" name = "name" size = "30" />
            <span class="redStar">*</span><br />
            Title:           <input type = "text" name = "title" size = "30" /><br />
            Company: <input type = "text" name = "company" size = "30" /></p>
            <p>Address 1: <input type = "text" name = "address1" size = "30" />
              <span class="redStar">*</span><br />
            Address 2: <input type = "text" name = "address2" size = "30" /><br />
            City: <input type = "text" name = "city" size = "30" />
            <span class="redStar">*</span> State: <input type = "text" name = "state" size = "3" />
            <span class="redStar">*</span> Zip: <input type = "text" name = "zip" size = "11" />
            <span class="redStar">*</span></p>
           <p>Email:   <input type = "text" name = "email" size = "30" />
             <span class="redStar">*</span><br />
            Phone: <input type = "text" name = "phone" size = "30" />
            <span class="redStar">*</span> </p>
            <p><input type = "submit" name = "submit" value = "Submit" /></p>
            <p><span class="redStar">*</span> These blanks must be filled in</p>
    </form>       
    and here is the page that handles the form (with the exception of the referring page, and other environmentals:
            <?php
            $ip = $_POST['ip'];
    $httpref = $_POST['httpref'];
    $httpagent = $_POST['httpagent'];
            $need = $_POST['need'];
            $name = $_POST['name'];
            $title = $_POST['title'];
            $company = $_POST['company'];
            $address1 = $_POST['address1'];
            $address2 = $_POST['address2'];
            $city = $_POST['city'];
            $state = $_POST['state'];
            $zip = $_POST['zip'];
            $email = $_POST['email'];
            $phone = $_POST['phone'];
    if(!$email == "" && (!strstr($email,"@") || !strstr($email,".")))
    echo "<h2>Use Back - Enter valid email</h2>\n";
    $badinput = "<h2>Your form was NOT submitted</h2>\n";
    echo $badinput;
    die ("Go back! ! ");
    if(empty($name) || empty($email) || empty($address1) || empty($city) || empty($state) || empty($zip) || empty($phone)) {
    echo "<h2>Use your Back button - fill in all starred fields, your form was not submitted.</h2>\n";
    die ("Use back! ! ");
    $todayis = date("l, F j, Y, g:i a") ;
    $subject = Contact_From_Website;
    $message = " $todayis [EST] \n
    From: $name ($email)\n
    Title: $title\n
    Company: $company\n
    Telephone: $phone ($phone)\n
    Address: $address1\n
    $address2\n
    City: $city\n
    State: $state\n
    Zip: $zip\n
    Phone: $phone\n
    Additional Info : IP = $ip \n
    Browser Info: $httpagent \n
    Referral : $httpref \n
    $from = "From: $email\r\n";
    mail("[email protected]", $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
    /* This is the part that emails everyone and is commented out for testing
    if ($need = "service") {
        mail("[email protected]", $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
    mail("[email protected]", $need, $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
        if ($need = "sales") {
        mail("[email protected]", $need, $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
            mail("[email protected]", $need, $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
        if ($need = "literature") {
            mail("[email protected]", $need, $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
    mail("[email protected]", $need, $name, $title, $company, $phone, $address1, $address2, $city, $state, $zip, $email, $phone, $ip, $httpref);
            ?>
            Date: <?php echo $todayis ?>
    <br />
    Thank You : <?php echo $name ?> ( <?php echo $email ?> )  <?php echo $title ?> <?php echo $company ?> <?php echo $phone ?> <?php echo $address1 ?> <?php echo $address2 ?> <?php echo $city ?> <?php echo $state ?> <?php echo $zip ?>
    <br /> You have requested <?php echo $need ?>
    <br /> Your IP Address has been recorded for your safety.
    <?php echo $ip ?>
    You can see where I am trying to go with this. I want to use the $need variable to determine where the email is going to go (two people in each case). But I am testing this script and cannot get to send me an email without any if statements.
    Where have I gone wrong?

    60251977 wrote:
    > I'm considering switching to Wordpress but have started
    building a site in
    > Dreamweaver, and am not especially keen on having to
    learn an entirely new
    > program.
    If you're not keen on learning, you might want to reconsider
    your plans.
    Creating a simple web page is easy, giving many beginners the
    false
    impression that website development is something anyone can
    do without
    acquiring specialist knowledge.
    > I want to create a simple "Add Comment" form so that
    when a visitor to my site
    > wants to comment, he can do so, press submit, and the
    page refreshes with his
    > comments inserted. Just like a blog.
    Yep, sounds simple enough, but so is turning the ignition key
    of a car.
    What you're ignoring is the underlying technology that not
    only makes it
    work, but makes it work safely. WordPress does all of this
    for you
    straight out of the box. To build it successfully in
    Dreamweaver
    requires a knowledge of PHP, MySQL, and SQL.
    > According to the Pickaweb FAQ, the path to PHP is
    "/usr/bin/php"
    If PHP is enabled on your site, the path to PHP is
    irrelevant.
    > If my site was called elephantlike.co.uk, what would I
    enter into the Action
    > field of the form wizard?
    > Would this make my form work? Or is there other stuff I
    need to know?
    What you enter in the Action field is the path to the script
    that
    processes the form input. If you're willing to learn the
    basics of PHP,
    MySQL, and SQL, you can create a comment form on your site
    with
    Dreamweaver. However, you need to be aware of security
    issues, such as
    cross-site scripting and dealing with spam. What looks simple
    at first
    glance is actually more complex. It's not rocket science, but
    it does
    involve a learning curve.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • What Internet Browser Settings Must Be Enable or Disabled for a PHP Form Script to Send a Form???

    Helo,
    I am running Windows XP Pro.
    What Are the Internet Browser Setting that can Stops my form''s data from being received as  emails.
    The Form Date is Received into Selected Email Boxes When the Form is Filled Out from Other PCs.
    http://www.collegestudentvoice.com/form.php
    1. All Emails boxes are set up.
    2. Have turned OFF NetworkSolution Firewall.
    3. Firefox  http referer is SET to  2.
    4. Form generated NO ERRORS  when I fill it out.
    cheers,
    Dreamweaver101.1

    Hello,
    The problem may be in a script but I also believe it has to do with my browser settings.
    How else to explain that the form's data is NOT  received  from my laptop but is received  from pc of my friend in LA and the form developer's pc.???
    There three files that deal with the form email script:
    1.   http://www.collegestudentvoice.com/form.php
    2.  http://www.collegestudentvoice.com/send-email-form.php
    3      FORM  ACTION.PHP File :
    <?php
      require_once('recaptchalib.php');
    $privatekey = "6LfwwsISAAAAAAPShkJ6nV3qkgLDHCe2uXj9RTWw";
      $resp = recaptcha_check_answer ($privatekey,
                                    $_SERVER["REMOTE_ADDR"],
                                    $_POST["recaptcha_challenge_field"],
                                    $_POST["recaptcha_response_field"]);
      if (!$resp->is_valid) {
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
      else {
    include_once('Mail.php');
    include_once('Mail/mime.php');
    $errors ='';
    $max_allowed_file_size = 10000000; // size in KB
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp");
    $upload_folder = 'files/';
        $name_of_uploaded_file =  basename($_FILES['uploaded_file']['name']);
        $type_of_uploaded_file = substr($name_of_uploaded_file,
                                strrpos($name_of_uploaded_file, '.') + 1);
        $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;
        if($size_of_uploaded_file > $max_allowed_file_size )
            $errors .= "\n Size of file should be less than $max_allowed_file_size";
        $allowed_ext = false;
        for($i=0; $i<sizeof($allowed_extensions); $i++)
            if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0)
                $allowed_ext = true;       
        if(!$allowed_ext)
            $errors .= "\n The uploaded file is not supported file type. ".
            " Only the following file types are supported: ".implode(',',$allowed_extensions);
        if(empty($errors))
            $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;
            $tmp_path = $_FILES["uploaded_file"]["tmp_name"];
            if(is_uploaded_file($tmp_path))
                if(!copy($tmp_path,$path_of_uploaded_file))
                    $errors .= '\n error while copying the uploaded file';
            $Business = Trim(stripslashes($_POST['Business']));
            $ProfessionalSports = Trim(stripslashes($_POST['ProfessionalSports']));
            $Humor101 = Trim(stripslashes($_POST['Humor101']));
            $CollegeSports = Trim(stripslashes($_POST['CollegeSports']));
            $Politics = Trim(stripslashes($_POST['Politics']));
            $EmailToBusiness = $Business . "@collegestudentvoice.net";
            $EmailToProfessionalSports = $ProfessionalSports . "@collegestudentvoice.net";
            $EmailToHumor101 =  $Humor101 ."@collegestudentvoice.net";
            $EmailToCollegeSports = $CollegeSports . "@collegestudentvoice.net";
            $EmailToPolitics = $Politics . "@collegestudentvoice.net";
            $EmailTo = "[email protected]";
            $EMailSubject = Trim(stripslashes($_POST['Subject']));
            $First = Trim(stripslashes($_POST['First']));
            $Last = Trim(stripslashes($_POST['Last']));
            $Email = Trim(stripslashes($_POST['Email']));
            $Suggestions = Trim(stripslashes($_POST['Suggestions']));
            $Body = "The following form has been filled";
            $Body .= "\n";
            $Body .= "---------------------------------------------------------------------------------";
            $Body .= "\n";
            $Body .= "\n";
            $Body .= "First Name: ";
            $Body .= $First;
            $Body .= "\n";
            $Body .= "Last Name: ";
            $Body .= $Last;
            $Body .= "\n";
            $Body .= "Email: ";
            $Body .= $Email;
            $Body .= "\n";
            $Body .= "Business: ";
            $Body .= $Business;
            $Body .= "\n";
            $Body .= "Professional Sports: ";
            $Body .= $ProfessionalSports;
            $Body .= "\n";
            $Body .= "Humor 101: ";
            $Body .= $Humor101;
            $Body .= "\n";
            $Body .= "College Sports: ";
            $Body .= $CollegeSports;
            $Body .= "\n";
            $Body .= "Politics: ";
            $Body .= $Politics;
            $Body .= "\n";
            $Body .= "Suggestions: ";
            $Body .= $Suggestions;
            $Body .= "\n";
            $Body .= "\n";
            $Body .= "---------------------------------------------------------------------------------\n";
            $Body .= "Emails sent to: " . strtolower($EmailToBusiness) . " / " .strtolower($EmailToProfessionalSports). " / " .strtolower($EmailToHumor101). " / " .strtolower($EmailToCollegeSports). " / ".strtolower($EmailToPolitics). "";
            $to = "[email protected]";
            $subject= $EMailSubject;
            $from = "[email protected]";
            $text = "\n $Body";
            $message = new Mail_mime();
            $message->setTXTBody($text);
            $message->addAttachment($path_of_uploaded_file);
            $body = $message->get();
            $extraheaders = array("From"=>$from, "Subject"=>$subject,"Reply-To"=>$Email);
            $headers = $message->headers($extraheaders);
            $mail = Mail::factory("mail");
            $mail->send($to, $headers, $body);
            if ($Business != "")
                        $mail->send(strtolower($EmailToBusiness), $headers, $body);
            if ($ProfessionalSports != "")
                        $mail->send(strtolower($EmailToProfessionalSports), $headers, $body);
            if ($Humor101 != "")
                        $mail->send(strtolower($EmailToHumor101), $headers, $body);
            if ($CollegeSports != "")
                        $mail->send(strtolower($EmailToCollegeSports), $headers, $body);
            if ($Politics != "")
                        $mail->send(strtolower($EmailToPolitics), $headers, $body);
            print "<meta http-equiv=\"refresh\" content=\"0;URL=form.php?suc=y\">";
    ?>

  • I am trying to use GoDaddy's gdform.php for a form mailer in Flash CS4. Can anybody help with coding

    Hello Everyone,
    I am starting to learn Flash and created a form mailer for a website I am working on.  The following code is what I have in AS3.0 and it all loads fine in the web browser, but I do not receive the email with the info.
    var address:String = "gdform.php";
    var url:URLRequest;
    var variables:URLVariables = new URLVariables ();
    variables.subject = "New Fighter Profile";
    submit_btn.addEventListener(MouseEvent.CLICK,sendForm);
    function sendForm(event:MouseEvent):void{
        variables.FirstName = firstname_txt.text;
        variables.LastName = lastname_txt.text;
        variables.Birthdate = birthdate_txt.text;
        variables.Nickname = nickname_txt.text;
        variables.HeightFt = hft_txt.text;
        variables.HeightIn = hin_txt.text;
        variables.Weightclass = weightclass_txt.text;
        variables.RecWins = wins_txt.text;
        variables.RecWins = losses_txt.text;
        variables.Debut = debut_txt.text;
        variables.Hometown = hometown_txt.text;
        variables.FightClub = fightclub_txt.text;
        variables.Styles = styles_txt.text;
        variables.Email = email_txt.text;
        variables.Bio = bio_txt.text;
        url = new URLRequest (address);
        url.method = URLRequestMethod.POST;
        url.data = variables;
        navigateToURL (url);
        var reqThanks:URLRequest=new URLRequest("thanks.html");
        navigateToURL(reqThanks,"_blank");
        var reqHome:URLRequest=new URLRequest("index.html");
        navigateToURL(reqHome,"_parent");
    Please Help!
    Thanks,
    John

    Maybe someone here can help.
    In spite of the site name, it is a Mac video card site.

  • Need help with PHP form with checkboxes, radio buttons and file attachment

    Hi guys,
    I'm having a nightmare with this PHP form where a user can fill it in, attach a doc/pdf and submit. After trying to sort it out with previous code I've used, I've stripped it out and think I should just start again in the hope you geniuses can help!
    Here is the HTML of contact.php:
    <form action="" method="post" name="contact" id="contact">
        <p>Job Title:*<br />
        <input name="position" type="text" /></p>
        <p>Nationality:*<br />
        <select name="nationality">
          <option value="">-- select one --</option>
          <option value="Afghan">Afghan</option>
          <option value="Albanian">Albanian</option>
          <option value="Algerian">Algerian</option>
          <option value="Zambian">Zambian</option>
          <option value="Zimbabwean">Zimbabwean</option>
        </select>
        </p>
        <p>Which country are you currently living in?*<br />
        <select name="country">
        <option value="">-- select one --</option>
        <option value="United Kingdom">United Kingdom</option>
        <option value="Afghanistan">Afghanistan</option>
        <option value="Africa">Africa</option>
        <option value="Zambia">Zambia</option>
        <option value="Zimbabwe">Zimbabwe</option>
        </select>
        </p>
        <label class="radio" for="checkRight">Yes/No question?</label><br />
        <input class="radio" type="radio" name="right" value="Yes" /> Yes
        <input class="radio" type="radio" name="right" value="No" /> No
        <input class="radio" type="radio" name="right" value="N/A" /> Not applicable
        <p>Yes/No question?<br />
        <select name="continue">
        <option value="">-- select one --</option>
        <option value="Yes">Yes</option>
        <option value="No">No</option>
        </select>
        </p>
        <p>Select your resorts:<br />
        Resort 1<input name="res1" type="checkbox" value="Resort 1" />
        Resort 2<input name="res2" type="checkbox" value="Resort 2" />
        Resort 3<input name="res3" type="checkbox" value="Resort 3" />
        Resort 4<input name="res4" type="checkbox" value="Resort 4" />
        Resort 5<input name="res5" type="checkbox" value="Resort 5" />
        Resort 6<input name="res6" type="checkbox" value="Resort 6" />   
        </p>
        <p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
        <p>Date of arrival: <input name="arrive" id="datepick" /><br />
        Date of departure: <input name="depart" id="datepick2" /></p>
        <script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
        <link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
        <script type="text/javascript">
        new datepickr('datepick');
        new datepickr('datepick2', {
        </script>
        <p>Name:*<br />
        <input name="name" type="text" /></p>
        <p>E-mail:*<br />
        <input name="email" type="text" /></p>
        <p>Telephone:*<br />
        <input name="telephone" type="text" class="ctextField" /></p>
        <p>Upload CV (Word of PDF formats only):<br />
        <input type="file" name="cv" class="textfield"></p>
        <p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    By the way, the date boxes work so excuse the Javascript in there!
    To prevent SPAM I've used a trick where there's a hidden URL field which must be left blank for the form to submit which you can see in the PHP.
    Below is where I'm at with the PHP which is placed above the header of contact.php...
    <?php
    if (array_key_exists('submit', $_POST)) {
        $position = $_POST['position'];
        $arrive = $_POST['arrive'];
        $nationality = $_POST['nationality'];
        $parttime = $_POST['parttime'];
        $depart = $_POST['depart'];
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
    $to = "[email protected]";
    $subject = "Recruitment Application";
    $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";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= 'From: My Website <[email protected]>' . "\r\n";
    $message= "
    $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.mywebsite.co.uk/sent.php' );
    ?>
    I would like to make pretty much all the field compulsory so if a field is left empty (other than the hidden URL field), a warning message is displayed next to that field.
    Also I would like the file upload field to attach to the email that is sent to me and have the results come through to me in a table format.
    Can anyone help me get my form working?
    Thank you and I hope to hear from you!
    SM

    Hi Nancy,
    Great stuff, thank you for the reply.
    I've managed to get the Formm@iler working and running as I need it to.
    The only thing I'm struggling with is when the user clicks submit, they are taken to a page of whatever results the form returned but it is just a white background with Times New Roman text.
    How can I have it so the user is taken to the form results in the websites' page layout?
    I tried sending them to a generic 'thank you' page by adding the following code but it just took them there whatever the results of the form so that's no good...! I have a feeling it's a bit more complicated than that...
    header( 'Location: http://www.nofussbus.co.uk/test/sent.php' );
    Thank you for your help!

  • My  PHP  form no longer works?

    Hi
    http://www.collegestudentvoice.com/form/form.php
    1. Programmer says there is no coding errors.  Nothing has changed.
    2. Host says there must be coding errors.
    3. There may version incompetibilities with Perl script between the form and the host version.
    these are 3 files:
    Sendform:
    <?php
    // Pear library includes
    // You should have the pear lib installed
    include_once('Mail.php');
    include_once('Mail/mime.php');
    //Settings
    $max_allowed_file_size = 10000000; // size in KB
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp");
    $upload_folder = 'files/'; //<-- this folder must be writeable by the script
    $your_email = '[email protected]';//<<--  update this to your email address
    $errors ='';
    if(isset($_POST['submit']))
        //Get the uploaded file information
        $name_of_uploaded_file =  basename($_FILES['uploaded_file']['name']);
        //get the file extension of the file
        $type_of_uploaded_file = substr($name_of_uploaded_file,
                                strrpos($name_of_uploaded_file, '.') + 1);
        $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;
        ///------------Do Validations-------------
        if(empty($_POST['name'])||empty($_POST['email']))
            $errors .= "\n Name and Email are required fields. ";   
        if(IsInjected($visitor_email))
            $errors .= "\n Bad email value!";
        if($size_of_uploaded_file > $max_allowed_file_size )
            $errors .= "\n Size of file should be less than $max_allowed_file_size";
        //------ Validate the file extension -----
        $allowed_ext = false;
        for($i=0; $i<sizeof($allowed_extensions); $i++)
            if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0)
                $allowed_ext = true;       
        if(!$allowed_ext)
            $errors .= "\n The uploaded file is not supported file type. ".
            " Only the following file types are supported: ".implode(',',$allowed_extensions);
        //send the email
        if(empty($errors))
            //copy the temp. uploaded file to uploads folder
            $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;
            $tmp_path = $_FILES["uploaded_file"]["tmp_name"];
            if(is_uploaded_file($tmp_path))
                if(!copy($tmp_path,$path_of_uploaded_file))
                    $errors .= '\n error while copying the uploaded file';
            //send the email
            $name = $_POST['name'];
            $visitor_email = $_POST['email'];
            $user_message = $_POST['message'];
            $to = $your_email;
            $subject="New form submission";
            $from = $your_email;
            $text = "A user  $name has sent you this message:\n $user_message";
            $message = new Mail_mime();
            $message->setTXTBody($text);
            $message->addAttachment($path_of_uploaded_file);
            $body = $message->get();
            $extraheaders = array("From"=>$from, "Subject"=>$subject,"Reply-To"=>$visitor_email);
            $headers = $message->headers($extraheaders);
            $mail = Mail::factory("mail");
            $mail->send($to, $headers, $body);
            //redirect to 'thank-you page
            header('Location: thank-you.html');
    ///////////////////////////Functions/////////////////
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <title>File upload form</title>
    <!-- define some style elements-->
    <style>
    label,a, body
        font-family : Arial, Helvetica, sans-serif;
        font-size : 12px;
    </style>   
    <!-- a helper script for vaidating the form-->
    <script language="JavaScript" src="scripts/gen_validatorv31.js" type="text/javascript"></script>   
    </head>
    <body>
    <?php
    if(!empty($errors))
        echo nl2br($errors);
    ?>
    <form method="POST" name="email_form_with_php"
    action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" enctype="multipart/form-data">
    <p>
    <label for='name'>Name: </label><br>
    <input type="text" name="name" >
    </p>
    <p>
    <label for='email'>Email: </label><br>
    <input type="text" name="email" >
    </p>
    <p>
    <label for='message'>Message:</label> <br>
    <textarea name="message"></textarea>
    </p>
    <p>
    <label for='uploaded_file'>Select A File To Upload:</label> <br>
    <input type="file" name="uploaded_file">
    </p>
    <input type="submit" value="Submit" name='submit'>
    </form>
    <script language="JavaScript">
    // Code for validating the form
    // Visit http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
    // for details
    var frmvalidator  = new Validator("email_form_with_php");
    frmvalidator.addValidation("name","req","Please provide your name");
    frmvalidator.addValidation("email","req","Please provide your email");
    frmvalidator.addValidation("email","email","Please enter a valid email address");
    </script>
    <noscript>
    <small><a href='http://www.html-form-guide.com/email-form/php-email-form-attachment.html'
    >How to attach file to email in PHP</a> article page.</small>
    </noscript>
    </body>
    </html>
    FORM:
    <!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>College Student</title>
    <link rel="stylesheet" type="text/css" href="css/view.css" media="all">
    <script type="text/javascript" src="js/view.js"></script>
    <script src="js/forms.js" type="text/javascript"></script>
    </head>
    <body id="main_body" >
        <div id="form_container">
    <form action="formaction.php" method="post" enctype="multipart/form-data" name="contactus" id="contactus"  style="border:none;" onsubmit="return validateForm()">
                        <div class="form_description">
                <h2><img src="CSVlogo.GIF" width="269" height="97" alt="Logo" /></h2>
                <p>Please type in your first and last names along with our school email address (i.e., [email protected]) when submitting your articles or photographs.</p>
    <p>Select the category that best describes the subject of  your article or photograph. (i.e., Business, Politics, Sports, Humor, etc.)</p>
    <p>When writing about a sporting event please include the name of the sport in the ‘Subject’ line of your email along with the date of the event and the names of the teams. (i.e., Basketball 01-15-11 L.A. Lakers vs.Detroit Pistons)</p>
            </div>       
            <div>
                    <?php
    if (isset($_GET['suc'])) {
    echo "<div style='color:#F00; padding:15px; display:block; margin:10px 0 10px 0;'> ";
    echo "Thank you for your submission!";
    echo "</div>";
    } else {
    ?>
    </div>
                <ul >
                        <li id="li_5" >
            <label class="description" for="Business">Business </label>
            <div>
            <select class="element select medium" name="Business">
                <option value="" selected="selected"></option>
    <option value="Classified" >Classified</option>
    <option value="careertips" >Career Tip</option>
            </select>
            </div>
            </li>        <li id="li_6" >
            <label class="description" for="ProfessionalSports">Professional Sports </label>
            <div>
            <select class="element select medium" name="ProfessionalSports">
                <option value="" selected="selected"></option>
    <option value="NBA" >NBA</option>
    <option value="NFL" >NFL</option>
    <option value="MLB" >MLB</option>
    <option value="otherprosports" >Other</option>
            </select>
            </div>
            </li>        <li id="li_7" >
            <label class="description" for="Humor101">Humor 101</label>
            <div>
            <select class="element select medium" name="Humor101">
                <option value="" selected="selected"></option>
    <option value="Cartoons" >Cartoons</option>
    <option value="Jokes" >Jokes</option>
    <option value="Stories" >Stories</option>
    <option value="Photographs" >Photographs</option>
            </select>
            </div>
            </li>        <li id="li_8" >
            <label class="description" for="CollegeSports">College Sports</label>
            <div>
            <select class="element select medium" name="CollegeSports">
                <option value="" selected="selected"></option>
    <option value="basketballcollege" >Basketball</option>
    <option value="baseballcollege" >Baseball</option>
    <option value="Footballcollege" >Football</option>
    <option value="Softball" >Softball</option>
    <option value="othercollege" >Other</option>
            </select>
            </div>
            </li>        <li id="li_9" >
            <label class="description" for="Politics">Politics</label>
            <div>
            <select class="element select medium" name="Politics">
                <option value="" selected="selected"></option>
    <option value="statelocal" >State/Local</option>
    <option value="National" >National</option>
    <option value="World" >World</option>
            </select>
            </div>
            </li>        <li id="li_1" >
            <label class="description" for="element_1">Name </label>
            <span>
                <input id="First" name="First" class="element text" maxlength="255" size="40" value=""/>
                <label>First</label>
            </span>
            <span>
                <input id="Last" name= "Last" class="element text" maxlength="255" size="40" value=""/>
                <label>Last</label>
            </span>
            </li>       
            <li id="li_sub" >
            <label class="description" for="Subject">Subject </label>
            <div>
                <input id="Subject" name="Subject" class="element text medium required" type="text" maxlength="255" value=""/>
            </div>
            </li>   
            <li id="li_2" >
            <label class="description" for="Email">Email </label>
            <div>
                <input id="Email" name="Email" class="element text medium required email" type="text" maxlength="255" value=""/>
            </div>
            </li>        <li id="li_3" >
            <label class="description" for="EmailC">Confirm Email </label>
            <div>
                <input id="EmailC" name="EmailC" class="element text medium" type="text" maxlength="255" value=""/>
            </div>
            </li>        <li id="li_4" >
            <label class="description" for="Suggestions">Suggestions </label>
            <div>
                <textarea id="Suggestions" name="Suggestions" class="element textarea medium"></textarea>
            </div>
            </li>
          <li id="li_5" >
            <label class="description" for="Upload">Upload File </label>
    <input type="file" name="uploaded_file">
            <div>
              </div>
            </li>
            <li id="li_6" >
            <label class="description" for="Upload">Are you human?</label>
            <?php
            require_once('recaptchalib.php');
              $publickey = "6LfwwsISAAAAAA7UTKJcDATLiK-e55gPFW1Opfrq"; // you got this from the signup page
              echo recaptcha_get_html($publickey);
            ?>
            <div>
              </div>
            </li>
                        <li class="buttons">
                    <input type="submit" name="Submit" value="Submit" class="button" />
    </li>
                </ul>
    </form>
    <!--        <div id="footer">
            </div>
    -->    </div>
    </body>
    </html>
    FORMACTION
    <?php
      require_once('recaptchalib.php');
    $privatekey = "6LfwwsISAAAAAAPShkJ6nV3qkgLDHCe2uXj9RTWw";
      $resp = recaptcha_check_answer ($privatekey,
                                    $_SERVER["REMOTE_ADDR"],
                                    $_POST["recaptcha_challenge_field"],
                                    $_POST["recaptcha_response_field"]);
      if (!$resp->is_valid) {
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
      else {
    include_once('Mail.php');
    include_once('Mail/mime.php');
    $errors ='';
    $max_allowed_file_size = 10000000; // size in KB
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp");
    $upload_folder = 'files/';
        $name_of_uploaded_file =  basename($_FILES['uploaded_file']['name']);
        $type_of_uploaded_file = substr($name_of_uploaded_file,
                                strrpos($name_of_uploaded_file, '.') + 1);
        $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;
        if($size_of_uploaded_file > $max_allowed_file_size )
            $errors .= "\n Size of file should be less than $max_allowed_file_size";
        $allowed_ext = false;
        for($i=0; $i<sizeof($allowed_extensions); $i++)
            if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0)
                $allowed_ext = true;       
        if(!$allowed_ext)
            $errors .= "\n The uploaded file is not supported file type. ".
            " Only the following file types are supported: ".implode(',',$allowed_extensions);
        if(empty($errors))
            $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;
            $tmp_path = $_FILES["uploaded_file"]["tmp_name"];
            if(is_uploaded_file($tmp_path))
                if(!copy($tmp_path,$path_of_uploaded_file))
                    $errors .= '\n error while copying the uploaded file';
            $Business = Trim(stripslashes($_POST['Business']));
            $ProfessionalSports = Trim(stripslashes($_POST['ProfessionalSports']));
            $Humor101 = Trim(stripslashes($_POST['Humor101']));
            $CollegeSports = Trim(stripslashes($_POST['CollegeSports']));
            $Politics = Trim(stripslashes($_POST['Politics']));
            $EmailToBusiness = $Business . "@collegestudentvoice.net";
            $EmailToProfessionalSports = $ProfessionalSports . "@collegestudentvoice.net";
            $EmailToHumor101 =  $Humor101 ."@collegestudentvoice.net";
            $EmailToCollegeSports = $CollegeSports . "@collegestudentvoice.net";
            $EmailToPolitics = $Politics . "@collegestudentvoice.net";
            $EmailTo = "[email protected]";
            $EMailSubject = Trim(stripslashes($_POST['Subject']));
            $First = Trim(stripslashes($_POST['First']));
            $Last = Trim(stripslashes($_POST['Last']));
            $Email = Trim(stripslashes($_POST['Email']));
            $Suggestions = Trim(stripslashes($_POST['Suggestions']));
            $Body = "The following form has been filled";
            $Body .= "\n";
            $Body .= "---------------------------------------------------------------------------------";
            $Body .= "\n";
            $Body .= "\n";
            $Body .= "First Name: ";
            $Body .= $First;
            $Body .= "\n";
            $Body .= "Last Name: ";
            $Body .= $Last;
            $Body .= "\n";
            $Body .= "Email: ";
            $Body .= $Email;
            $Body .= "\n";
            $Body .= "Business: ";
            $Body .= $Business;
            $Body .= "\n";
            $Body .= "Professional Sports: ";
            $Body .= $ProfessionalSports;
            $Body .= "\n";
            $Body .= "Humor 101: ";
            $Body .= $Humor101;
            $Body .= "\n";
            $Body .= "College Sports: ";
            $Body .= $CollegeSports;
            $Body .= "\n";
            $Body .= "Politics: ";
            $Body .= $Politics;
            $Body .= "\n";
            $Body .= "Suggestions: ";
            $Body .= $Suggestions;
            $Body .= "\n";
            $Body .= "\n";
            $Body .= "---------------------------------------------------------------------------------\n";
            $Body .= "Emails sent to: " . strtolower($EmailToBusiness) . " / " .strtolower($EmailToProfessionalSports). " / " .strtolower($EmailToHumor101). " / " .strtolower($EmailToCollegeSports). " / ".strtolower($EmailToPolitics). "";
            $to = "[email protected]";
            $subject= $EMailSubject;
            $from = "[email protected]";
            $text = "\n $Body";
            $message = new Mail_mime();
            $message->setTXTBody($text);
            $message->addAttachment($path_of_uploaded_file);
            $body = $message->get();
            $extraheaders = array("From"=>$from, "Subject"=>$subject,"Reply-To"=>$Email);
            $headers = $message->headers($extraheaders);
            $mail = Mail::factory("mail");
            $mail->send($to, $headers, $body);
            if ($Business != "")
                        $mail->send(strtolower($EmailToBusiness), $headers, $body);
            if ($ProfessionalSports != "")
                        $mail->send(strtolower($EmailToProfessionalSports), $headers, $body);
            if ($Humor101 != "")
                        $mail->send(strtolower($EmailToHumor101), $headers, $body);
            if ($CollegeSports != "")
                        $mail->send(strtolower($EmailToCollegeSports), $headers, $body);
            if ($Politics != "")
                        $mail->send(strtolower($EmailToPolitics), $headers, $body);
            print "<meta http-equiv=\"refresh\" content=\"0;URL=form.php?suc=y\">";
    ?>

    bregent,
    you have explained everything was is happening.
    Mine firewall setttings block the scrip so when I fill the form and submit it, I do not get any errors, but that form information does not go anywhere.
    All firewall setting should be OFF  when a form is submitted?
    dreamweavewr101.1

Maybe you are looking for

  • I have Acrobat 9 Pro Extended and would like it to recognize text.  Does anyone know how to do this?

    Our administrator upgraded my computer and Adobe Acrobat now looks different.  Prior to that, I used the tool tab that was in the upper right hand corner for text recognition.  This new version does not have those tabs and I do not see the text optio

  • Disc erase failed with error invalid request

    HI, I'm trying to get a new 2.5tb external wd hard drive to work with both my mac and my old pc - so i can backup my old data from the pc. i have tried using disc utility, and erasing the disk and reformating to ms-dos (fat) format and recieve the fo

  • Iphoto has detected inconsistencies with your library

    i have just reloaded my osx 10.8.2 and migrated from my external hard drive... now when i open iphoto i get a message like the "iphoto has detected inconsistencies with your library" can anyone help?

  • Best graphics card for Gigabit Ethernet?

    Hi, I wanna upgrade my Power Mac G4's AGP graphics card to the best one available so I can get Quartz Extreme, Core Image, and Core Animation (for when I upgrade to Leopard). What's the best card available for my Power Mac? Thanks

  • OW4J vs. BPEL

    Hi, I am currently evaluating which BPM framework to use for an eBusiness B2B enterprise application. I am currently considering using the ebXML standards framework from OASIS, and plan to use ORACLE products namely Oracle DB + Application server. It