Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    9
    Member #
    9424
    hi, im new to php so not quite sure of everything yet but im trying to send an email from a form in a flash swf file using PHP which i have been told is the best and easyest way to do it. iv done what i can and at the moment an email is sent to the correct address when the send button is pressed but the info entered in to the form are not imported in to the email, so apart from the section headers that are added by the PHP script the email is blank. Im pretty sure that the problem is something to do with the PHP script not knowing how to retrieve the info properly due to it coming from a .swf file,although i could be wrong. ill post the actionscript and PHP script below.
    Any help would be great, can you help me get it to work.

    cheers

    -------------actionscript--------------
    on (release) {
    if (!email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
    EmailStatus = "Please enter an email address";
    } else if (!name.length) {
    EmailStatus = "Please enter a name";
    } else if (!enquiry.length) {
    EmailStatus = "Please enter an enquiry";
    } else {
    loadVariablesNum("MailPHP.php", "0", "POST");
    EmailStatus = "Sending... Please wait";
    }
    }

    -------------PHP----------------
    <?
    $ToEmail = "info@mortal-wombat.com";

    ##$ToName = "Mortal Wombat";
    $ToSubject = "Enquiry for Mortal Wombat";

    $EmailBody = "Sent By: $name\nSenders Email: $email\nSenders Company: $company\nTelephone: $tel\n\nMessage Sent:\n$enquiry\n";

    $EmailFooter="\nThis message was sent by: $name from www.mortal-wombat.com If you feel that you recieved this e-mail by accident please contact us at info@mortal-wombat.com";

    $Message = $EmailBody.$EmailFooter;

    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$name." <".$email.">");


    Print "_root.Mail.EmailStatus=Complete - Your mail has been sent, thank you";

    ?>


    thanks

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    There are no definition for $ToName in your supplied script.
    Additionally, you are using "<" instead of their HTML equivalent &lt; &gt; which will make the values in between invisible.

    The simplest mail script contains only the values "To, Subject, Message". If you want to include additional parameters, you have to add them in the fourth slot assigned to optional headers. For every header command, you have to separate them with a carriage return and newline symbol. Some servers requires these symbols to be additionally seperated with blank spaces.

    The mail() function needs these paramaters minimum:
    mail($to, $subject, $body [, optional header parameters which have to be separated by "\r\n" markers]);

    Read more about the function here:[phpfunction]function.mail[/phpfunction]

    and do a forum search.
    (One of many links here):
    S. Rosland

  4. #3
    Member
    Join Date
    Jan 2005
    Posts
    97
    Member #
    8727
    Your problem I think is register_globals. You have to use $_POST['yourformfieldname'](for form POSt fields) when it is turned off, which, it should be and it is disabled by default in current versions of PHP.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:53 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com