Results 1 to 4 of 4

Thread: Flash & PHP mail form problem

  1. #1

    Flash & PHP mail form problem

    Hi!

    I tried out the tutorial on creating forms in flash with PHP from http://www.kirupa.com/developer/acti..._php_email.htm

    It works great, however I had to add some extra stuff, as the form has the request as below : firstname, lastname, address, phone, website and comments.

    In the PHP coding for email.php from Kirupa's example, the code is as below:
    $message = $_POST["message"]"];

    However, I've added the input text in flash for address, phone and url address the user can submit to. I changed the coding below, and please dun laugh as I just started wading the water with PHP:
    $message = $_POST["addressbar"]. $_POST["website"]. $_POST["phone"]. $_POST["comments"];

    When I click the submit button, it works fine, accept when I check in my email, the contents in "addressbar", "website", "phone" and "comments" are all joined together with no space in between. Example as below when I check my email to test the form.

    POBOXTestingCountry1200www.google.com11220035

    Is there any way to separate them to look like this in my email?:

    POBOXTesting
    Country
    1200
    www.google.com
    11220035

    Do help! Boss is breathing down my neck!

  2. #2
    I have another problem, whereby if the user does not fill in all the text fields, a message will come out saying "Please fill in the fields mark *". I tried the code below, i thought it works at first, but when I test in on the server, I did not receive any email.
    Below is the code:
    on (release) {
    if (firstname == undefined || lastname == undefined || addressbar == undefined || email == undefined){
    _root.questions.gotoAndPlay("blanks");
    } else {
    _root.questions.form.loadVariables("email.php", "POST");
    }
    }

    I tried filling in all the blanks, and the message still appears, and no data is send to the email! Please do help!

  3. #3
    Quote Originally Posted by rykong196
    Hi!

    I tried out the tutorial on creating forms in flash with PHP from http://www.kirupa.com/developer/acti..._php_email.htm

    It works great, however I had to add some extra stuff, as the form has the request as below : firstname, lastname, address, phone, website and comments.

    In the PHP coding for email.php from Kirupa's example, the code is as below:
    $message = $_POST["message"]"];

    However, I've added the input text in flash for address, phone and url address the user can submit to. I changed the coding below, and please dun laugh as I just started wading the water with PHP:
    $message = $_POST["addressbar"]. $_POST["website"]. $_POST["phone"]. $_POST["comments"];

    When I click the submit button, it works fine, accept when I check in my email, the contents in "addressbar", "website", "phone" and "comments" are all joined together with no space in between. Example as below when I check my email to test the form.

    POBOXTestingCountry1200www.google.com11220035

    Is there any way to separate them to look like this in my email?:

    POBOXTesting
    Country
    1200
    www.google.com
    11220035

    Do help! Boss is breathing down my neck!
    Change you PHP code to this:
    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
    If you want to use the last option, the HTML email, you will have to add a few headers. MAIL function information
    Check that page for mail information.
    I don't have any answer on you next question because I am still a n00b in Flash.

    Success,
    // Paul

  4. #4
    Hey it works!@


    Thanks a bunch!

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 kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012