I’m having trouble with this previous posted tutorial. I followed the instructions step by step but it just didn’t work for me.
In the PHP Script I replaced this line:
[COLOR=#000000][COLOR=#0000BB]$Email [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]‘email’[/COLOR][COLOR=#007700]];
[/COLOR][/COLOR]
With this line:
[COLOR=#000000][COLOR=#0000BB]$Email [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]“my@email.com”[/COLOR][COLOR=#007700];
[/COLOR][/COLOR]
So I know the problem isn’t there. I have recorded 1min.11sec screen shot video of exactly what I did. If anyone can check it out and let me know what I did wrong I would greatly appreciate it. Click her for the screenshot video.
Part 2: Sending variables from a Flash Movie to a PHP script, and then using that PHP script to send an e-mail.**
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ok, this is basically a combination of the post above, and this thread that I created the other night about using the mail() function: Click Here!
Since most of this is already explained in those two posts, this section of the tutorial is going to be small because it serves only as a link between those two. Here we go!
[SIZE=4]Flash Set-up[/SIZE]
The only difference between this file and the file before is the script for the button. You set everything up the same way. Create the input text boxes and give them a suitable name. I gave my three input boxes the names “name”, “email”, and “message”.
The code on the button changes a little because now, we don’t want to open another page. We just want the e-mail to be sent when the user clicks the Flash button. So, we won’t be using getURL() but instead we will use loadVariablesNum(). The code looks like this:
ActionScript Code:
[LEFT]sendButton.[COLOR=#0000FF]onPress[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]loadVariablesNum[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"mailTut.php"[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#FF0000]"POST"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
this takes the variables from level “0” and sends them to the script contained in “mailTut.php” using the “POST” method.
[SIZE=4]PHP Set-up[/SIZE]
Now, if you read thru those other two posts that I showed you, then you should have no problem understanding the rest of this post. If you didn’t read thru them, then you still won’t have a problem because its very simple. Here is the code:
PHP Code:
[LEFT] [COLOR=#000000] [COLOR=#0000BB]<?
[/COLOR][COLOR=#FF8000]// Recieving and Creating Variables…
[/COLOR][COLOR=#0000BB]$Name [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]‘name’[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000BB]$Email [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]‘email’[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000BB]$Message [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]‘message’[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000BB]$Subject [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]“Test E-mail Tutorial”[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$Header [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]“From: $Name <$Email>”[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#FF8000]//Performing Mail script…
[/COLOR][COLOR=#0000BB]mail[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$Email[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$Subject[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$Message[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$Header[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]?>[/COLOR] [/COLOR] [/LEFT]
The first 5 lines of code are “Recieving and Creating Variables”. This recieves the variables from the Flash movie and then creates the Subject and Header variables to be used in the mail() script.
The mail() script is then executed. I already explained all of this stuff in the other tutorial that can be found here: Click Here
Ok thats its for this one.
[edit]Sorry, I had to take out the script in action link because the server that the script was set up on was taken down.[/edit]
Cheers,
Jubs :geek: