A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [CS3] AS2 Flash email form help please...

  1. #1
    An Electronic Punk
    Join Date
    Apr 2007
    Posts
    21

    [CS3] AS2 Flash email form help please...

    Hi Guys

    Ive made this email form from kirupa which works great...

    http://www.kirupa.com/developer/acti..._php_email.htm

    I want to add a phone number variable/field to it, so when the email comes thru to me I have their phone number too.

    Im sure its pretty simple and ive tried implementing it myself but cannot get it to work now.

    Please help.

    Thanks

    Ben

  2. #2
    I Love India Nalini_v's Avatar
    Join Date
    Jun 2007
    Location
    Chennai
    Posts
    195
    Hello,

    Do u want to send the phone numbers from the flash to mail?

    If s

    then to get the number say "phone" - the variable in which u are stored the phone number value in php use

    $phone = $_POST["phone"];

    then concatenate the phone variable after the message body

    like

    $message = $_POST["message"].$phone;

    then as given in the kirupa u can follow.

    All the best.

  3. #3
    An Electronic Punk
    Join Date
    Apr 2007
    Posts
    21
    Hi Nalini

    Thanks for your response. I am just looking at this now, I have labelled the variable in the flash to 'phone' and have the following in my php, is that right?

    <?php

    $sendTo = "email address goes here";
    $subject = "Subject line goes here";

    $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . " " . $_POST["email"] ." \r\n";

    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= "Return-path: " . $_POST["email"];

    $message = $_POST["message"].$phone;
    $phone = $_POST["phone"];

    mail($sendTo, $subject, $message, $headers);

    ?>

    Please come back to me.

    Thanks for your help.

    Ben

  4. #4

  5. #5
    An Electronic Punk
    Join Date
    Apr 2007
    Posts
    21
    Hi Nalini - im afraid it doesnt work. Any ideas?

  6. #6
    I Love India Nalini_v's Avatar
    Join Date
    Jun 2007
    Location
    Chennai
    Posts
    195
    Hi,

    PHP Code:
    <?php

    $sendTo 
    "email address goes here";
    $subject "Subject line goes here";

    $headers "From: " $_POST["firstName"] ." "$_POST["lastname"] . " " $_POST["email"] ." \r\n";

    $headers .= "Reply-To: " $_POST["email"] . "\r\n";
    $headers .= "Return-path: " $_POST["email"];

    $phone $_POST["phone"];
    $message $_POST["message"].$phone;

    mail($sendTo$subject$message$headers);

    ?>

    I checked this... note that the phone variable should be set before it is concatenated..

    THanks,

  7. #7
    I Love India Nalini_v's Avatar
    Join Date
    Jun 2007
    Location
    Chennai
    Posts
    195
    Also to ensure mail has been sent to the receipient check using if

    PHP Code:
    if (mail($sendTo$subject$message$headers)) {
      echo(
    "<p>Message successfully sent!</p>");
     } else {
      echo(
    "<p>Message delivery failed...</p>");
     } 
    Hope this will help u.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center