Results 1 to 4 of 4

Thread: Flash/PHP

  1. #1

    Thread Starter
    Hyperactive Member Olly79's Avatar
    Join Date
    May 2005
    Posts
    264

    Flash/PHP

    Hi all,

    Just wondering if anyone can help me with the following issue:

    I have a contact form in .flash and I'm using PHP to make it live;

    Code:
    on(release) {
    if (your name eq "" or your email eq "" or message eq "") {
    		stop();
    	} else {
    		loadVariablesNum("form.php", 0, "POST");
    		gotoAndStop(2);
    	}
    }
    I have created my form.php file:

    PHP Code:
    <?

    $destination="[email protected]";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['comments'];
    $subject="Message from $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Comments: $mes\n";
    mail($destination,$subject,$mes); ?>
    And I'm now calling this function through the following ActionScript:

    Code:
    on(rollOver) {
    	
    		this.gotoAndPlay("s1");
    	
    }
    
    on(rollOut, releaseOutside) {
    		
    		this.gotoAndPlay(_totalframes - _currentframe);
    	
    }
    
    
    on(release) {
    if (your name eq "" or your email eq "" or message eq "") {
    		stop();
    	} else {
    		loadVariablesNum("form.php", 0, "POST");
    		gotoAndStop(2);
    	}
    }
    However the button doesn't appear to be active. I have checked my variables, server has PHP and I'm left wondering what else! Could anyone provide assistance.

    Much appreciated.

    Olly
    Last edited by Olly79; Apr 11th, 2007 at 11:37 AM.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Flash/PHP

    Is that ActionScript code? It's certainly not PHP.

  3. #3

    Thread Starter
    Hyperactive Member Olly79's Avatar
    Join Date
    May 2005
    Posts
    264

    Re: Flash/PHP

    Yes, sorry I forgot to add my PHP code:

    PHP Code:
    <?

    $destination="[email protected]";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['comments'];
    $subject="Message from $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Comments: $mes\n";
    mail($destination,$subject,$mes); ?>
    Code:
    <?
    
    NOW ADDED TO THE ABOVE EXAMPLE
    
    ?>
    Last edited by Olly79; Apr 11th, 2007 at 11:47 AM.

  4. #4
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Flash/PHP

    when you run that script alone, does it send the email? if not, then you might not have an smtp server installed that PHP can use to send the email.

    other than that, I've no experience with using actionscript -- so I'm afraid I can't be of much help other than the basics. from looking over what you have, it seems simple enough to grasp. let me know if the script works on its own or not.

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