The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 7 of 7

Thread: adding new field to form and PHP

  1. #1

    adding new field to form and PHP


    I am using this script for my first simple mailform:

    $sendTo = "";
    $subject = "Videoproducties";

    $headers = "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= "Return-path: " . $_POST["email"];
    $message = $_POST["message"];
    mail($sendTo, $subject, $message, $headers);
    I have added an extra input text field to my flash form, and gave it the var name 'question' . How should i add this in the PHP script??

    Another question is:
    Can I add a checkbox to a form like this?
    How should I add that to the PHP script (I can't give a var name to the checkbox in Flash, can I?)

    Thank you very much!

    registro ergo sum

  2. #2

    Just add that var to the $message


    I have a similar script on one of my sites. I will paste it for you to look at, albeit my $message is set up as HTML

    PHP Code:

    "" ", " ;

    $subject "Whatever";

    $message =   "<html>
                         <td>Email Address:&nbsp;-&nbsp;</td><td>

    $headers  "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: $name <$email>\r\n";



  3. #3
    Another question is:
    Can I add a checkbox to a form like this?
    I think you can do the same as you would any other var. Just refernce that var in the $message of the php script and the value of the checkbox should show. Not 100% about that one though.


  4. #4
    thanks for your answer,
    but I just dont know how to add extra vars to the message in PHP language!

    registro ergo sum

  5. #5
    PHP Code:
    $message $_POST["message"]; 
    This is your last line in the php script. Do you actually have a var named message in flash?? if so then you can do the following:

    PHP Code:
    $message $_POST["message"];
    $message .= $_POST["question"]; 
    if you don't then:

    PHP Code:
    $message $_POST["question"]; 
    should work....

  6. #6

    jerryj - even simpler

    try this as TVIRUS pointed out in another thread.

    PHP Code:
    $addressbar $_POST['addressbar']; 
    $website $_POST['website']; 
    $phone $_POST['phone']; 
    $comments $_POST['comments']; 

    // For spaces between the values use this 
    $message    $addressbar." ".$website." ".$phone." ".$comments

    // For new lines use this 
    $message    $addressbar."\n".$website."\n".$phone."\n".$comments

    // For HTML email use this 
    $message    $addressbar."<br>".$website."<br>".$phone."<br>".$comments

  7. #7
    very helpfull.

    thank you!
    registro ergo sum

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012