|
-
Apr 10th, 2007, 03:44 PM
#1
Thread Starter
Hyperactive Member
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.
-
Apr 10th, 2007, 04:55 PM
#2
Re: Flash/PHP
Is that ActionScript code? It's certainly not PHP.
-
Apr 10th, 2007, 05:11 PM
#3
Thread Starter
Hyperactive Member
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.
-
Apr 10th, 2007, 06:32 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|