+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: E-mail Flash Form with PHP3

  1. #1
    kennbona is offline x10Hosting Member kennbona is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Malta
    Posts
    27

    E-mail Flash Form with PHP3

    hi, I'm currently working on a flash Contact Us Form for my website. I tried Following a tutorial but so far no luck.

    There are basically two files, The flash.swf "form" and the mail.php3 file.

    this is the code i have used:
    PHP3
    Code:
    <?php
     mail("smartwebsolutions@mail.com", $_GET["first_name"], $_GET["last_name"], $_GET["address"], $_GET["town"], $_GET["telephone"], $_GET["mail"], $_GET["business_name"], $_GET["business_type"], $_GET["app_date"], $_GET["comments"], "From: PHPMailer
    Reply-To: $_GET["from"]
    X-Mailer: PHP/" . phpversion());
     ?>
    This is the ActionScript i used:
    Code:
    Send_Form.onRelease = function()
    {    
            var first_name:String = First_Name.text;
            var last_name:String = Last_Name.text;
            var address:String = Address.text;
            var telephone:String = Telephone.text;
            var mail:String = E_Mail.text;
            var business_name:String = Business_Name.text;
            var business_typs:String = Business_Typs.text;
            var app_date:String = App_Date.text;
            var comments:String = Comments.text;
            errmsg.text = "Please wait... Connecting";
            lineAdapt();
            loadVariablesNum("mail.php3", 0, "POST");
            gotoAndStop(3);
    }
    Basically frame 3 has a simple E-mail sent message.
    and i also have this:
    Code:
    function lineAdapt () 
    {
        message_send = message;
         while (msg_count<length(message)) 
        {
            msg_count = msg_count+1;
              if ((substring(message_send, msg_count, 2)) eq "") 
              {
                  message_send = (substring(message_send, 1, msg_count-2))+ "" +(substring(message_send, msg_count+2,(length(message_send))-msg_count+2));
              }
         }
         message = message_send;
         delete msg_count;
         delete message_send;
    }
    this is where i got the tutorial and most f the code from : http://www.actionscript.org/resource...PHP/Page2.html
    Obviously i tried complicating mine beyond my level..
    I hope someone can help me understand what i'm doing wrong.

    Thanks in advance
    Kenneth Bonanno

  2. #2
    tittat's Avatar
    tittat is offline x10 Spammer tittat is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Kerala,India
    Posts
    2,479

    Re: E-mail Flash Form with PHP3

    Tutorials section is only for teaching and learning how to do things on the internet.
    This sort of questions should be on Programing help.
    *****Thread Moved to Programming Help*****
    PLAY ONLINE GAMES
    WWW.TMONDO.COM PlayFar Flash Games
    Former X10 Forum Senior Moderator(Retired)


  3. #3
    kennbona is offline x10Hosting Member kennbona is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Malta
    Posts
    27

    Re: E-mail Flash Form with PHP3

    ye sorry for that, only realized after i posted it..

    so, any ideas anyone? It's really frustrating when you have something in your mind but you lack the experience or knowledge to make it work.

  4. #4
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: E-mail Flash Form with PHP3

    Well first of all, php3 is not supported anymore, so you could try to find one using php5
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  5. #5
    kennbona is offline x10Hosting Member kennbona is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Malta
    Posts
    27

    Re: E-mail Flash Form with PHP3

    found one with php4.... would that work? cant find any php5

  6. #6
    FengFeng's Avatar
    FengFeng is offline x10Hosting Member FengFeng is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    China,Canton
    Posts
    59

    Re: E-mail Flash Form with PHP3

    what verison of action scripts do u use?
    Edit:
    I think the problem is in your AS code.It isn't so easy to post request in flash.You can use this php5 code to check the request.

    <?php
    print_r($_POST[]);
    ?>
    If you get nothing,it's the AS issue.Otherwise,it's the php issue.It's easy to mail in x10hosting,becasue it support the mail function.You can search many info abt mail() in php5.
    Last edited by FengFeng; 05-12-2009 at 03:23 AM. Reason: Automerged Doublepost

  7. #7
    kennbona is offline x10Hosting Member kennbona is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Malta
    Posts
    27

    Re: E-mail Flash Form with PHP3

    ok, i just scrapped my old form.. And followed a video tutorial and i did everything step by step.. identical to the tutorial... I managed to receive the e-mail.. but The variables couldn't be read... so i'm getting this:

    Name:
    Email:

    Message:

    this is the php code that i used:

    PHP Code:
    <?PHP

    $to 
    "***********@mail.com";
    $subject "Flash contact Form";
    $message "Name: " $theName;
    $message .= "\nEmail: " $theEmail;
    $message .= "\n\nMessage: " $theMessage;
    $headers "From: $theEmail";
    $headers .= "\nReply-To: $theEmail";

    $sentOk mail($to,$subject,$message,$headers);

    echo 
    "sentOk" $sentOk;

    ?>

    and this is the AS code.. btw using AS2

    Code:
    stop();
    
    var senderLoad:LoadVars = new LoadVars();
    var receiveLoad:LoadVars = new LoadVars();
    
    sender.onRelease = function() {
    	senderLoad.theName = theName.text;
    	senderLoad.theEmail = theEmail.text;
    	senderLoad.theMessage = theMessage.text;
    	senderLoad.sendAndLoad("http://www.**************.com/send.php",receiveLoad);
    }
    
    receiveLoad.onLoad = function() {
    	if(this.sentOk) {
    		_root.gotoAndStop("success");
    	}
    	else {
    		_root.gotoAndStop("failed");
    	}
    }
    Last edited by kennbona; 05-12-2009 at 04:36 AM.

  8. #8
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: E-mail Flash Form with PHP3

    As of PHP 4.2.0, register_globals is off by default, which means you need to reference $_GET, $_POST or $_REQUEST to get the form variables. I prefer $_REQUEST so that I may change the submission method/use different methods. Others prefer using $_POST under the (mistaken) belief that it's more secure.

    Read "Variables from External Sources" for more information on form variables.

    Since the form handler isn't printing HTML, you'd better put a header('Content-type: text/plain') line in the script, somewhere before you print any other output.

    Before you get too far into this, what's the reason you're using Flash? If you're doing this as a learning experience, or you're writing a Flex application, that's one thing, but for a web form, Flash is a poor choice when it comes to accessibility. Screen readers and many cell phones don't support flash.
    Last edited by misson; 05-12-2009 at 03:03 PM. Reason: added 'header()' info

  9. #9
    kennbona is offline x10Hosting Member kennbona is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Malta
    Posts
    27

    Re: E-mail Flash Form with PHP3

    thanks for your reply mission,
    I know flash is not the best option to use for online forms, but a friend of mine needs to have
    this think made of flash,... tried to give him other alternatives but he's just interested.

    going to give this a try.. however i not familiar with php at all.. so please gueid me in the right direction..

    origional Script:
    PHP Code:
    <?PHP

    $to 
    "smartwebsolutions@mail.com";
    $subject "Flash contact Form";
    $message "Name: " $theName;
    $message .= "\nEmail: " $theEmail;
    $message .= "\n\nMessage: " $theMessage;
    $headers "From: $theEmail";
    $headers .= "\nReply-To: $theEmail";

    $sentOk mail($to,$subject,$message,$headers);

    echo 
    "sentOk" $sentOk;

    ?>
    should i change the only one where it says echo? what about the others like $message and $headers?

    so something like this?:
    PHP Code:
    <?PHP

    header
    ('Content-type: text/plain');
    $to "smartwebsolutions@mail.com";
    $subject "Flash contact Form";
    $message "Name: " $_REQUEST['$theName'];
    $message .= "\nEmail: " .$_REQUEST[' $theEmail'];
    $message .= "\n\nMessage: " $_REQUEST['$theMessage'];
    $headers "From: " $_REQUEST['$theEmail'];
    $headers .= "\nReply-To:" $_REQUEST['$theEmail'];

    $sentOk mail($_REQUEST['$to,$subject,$message,$headers']);

    echo 
    "sentOk" $_REQUEST['$sentOk'];

    ?>

  10. #10
    ziyadg is offline x10Hosting Member ziyadg is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    2

    Re: E-mail Flash Form with PHP3

    Try these

    PHP Code:
    <?PHP

    $theName 
    $_POST['theName'];
    $theEmail $_POST['theEmail'];
    $theMessage $_POST['theMessage'];


    $to "smartwebsolutions@mail.com";
    $subject "Flash contact Form";
    $message "Name: " $theName;
    $message .= "\nEmail: " $theEmail;
    $message .= "\n\nMessage: " $theMessage;
    $headers "From: $theEmail";
    $headers .= "\nReply-To: $theEmail";

    $sentOk mail($to,$subject,$message,$headers);

    if(
    $sentOk) {
        echo 
    "status=Message Sent!";
    } else {
        echo 
    "status=Sending Failed.";
    }

    ?>
    Code:
    // AS2
    
    var loadVars:LoadVars = new LoadVars();
    var responseHandler:LoadVars = new LoadVars();
    loadVars.theName = "Name";
    loadVars.theEmail = "Email";
    loadVars.theMessage = "The Message";
    
    loadVars.sendAndLoad("myphpfile.php", responseHandler, "POST");
    
    responseHandler.onLoad = function() {
        status.text = responseHandler.status;
    }

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Mail Form needs HTML change ...
    By vodkasoda in forum Free Hosting
    Replies: 3
    Last Post: 04-27-2009, 11:08 AM
  2. [5$]Get the Flash contact us Form
    By agroup in forum Ads & Offers
    Replies: 3
    Last Post: 12-18-2008, 09:30 AM
  3. [OFF] [1500-credits]Get Flash Form
    By agroup in forum The Marketplace
    Replies: 7
    Last Post: 12-18-2008, 08:22 AM
  4. Get Flash contact us Form
    By agroup in forum Ads & Offers
    Replies: 1
    Last Post: 12-17-2008, 09:36 AM
  5. Sending Form to Mail
    By Ryuji666 in forum Programming Help
    Replies: 5
    Last Post: 08-15-2008, 02:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers