Hi all,
A newbie at Flash but have created a contact form that sends 3 lots of data (name, email and message) to my email address.
here is my code for my flash form which looks right
import flash.net.URLVariables;
import flash.net.URLRequest;
InteractiveObject(theName.getChildAt(1)).tabIndex = 1;
InteractiveObject(theEmail.getChildAt(1)).tabIndex = 2;
InteractiveObject(theMessage.getChildAt(1)).tabIndex = 3;
/* Mouse Click Event
Clicking on the specified symbol instance executes a function in which you can add your own custom code.
Instructions:
- Add your custom code on a new line after the line that says “// Start your custom code” below.
The code will execute when the symbol instance is clicked.
*/
sendBtn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_5);
function fl_MouseClickHandler_5(event:MouseEvent):void
{
if (theName.text == “” || theEmail.text == “” || theMessage.text == “”)
{
theFeedback.text = “Please fill out all fields.”;
}
else
{
// create a variable container
var allVars:URLVariables = new URLVariables();
allVars.name = theName.text;
allVars.email = theEmail.text;
allVars.message = theMessage.text;
//Send info to a url
var mailAddress:URLRequest = new URLRequest(“http://www.mydomainname.com/php.php”);
mailAddress.data = allVars;
mailAddress.method = URLRequestMethod.POST;
sendToURL(mailAddress);
theFeedback.text = “Thank you!”;
theName.text = “”;
theEmail.text = “”;
theMessage.text = “”;
}
}
here is my php page called php.php and it sends an email thru but the data is missing i.e. name, email, mesage $subject comes through and $body minus the data
[COLOR=red]<?php[/COLOR]
[COLOR=red]$name = $_POST[“allVars.name”];[/COLOR]
[COLOR=red]$email = $_POST[“allVars.email”];[/COLOR]
[COLOR=red]$message = $_POST[“allVars.message”];[/COLOR]
[COLOR=red]$subject = “Contact Information”;[/COLOR]
[COLOR=red]$headers = “from: $email”;[/COLOR]
[COLOR=red]$emailto = “[/COLOR][COLOR=red]myemailaddress[/COLOR][COLOR=red]”;[/COLOR]
[COLOR=red]$body = “The person who filled out [/COLOR]
[COLOR=red]this contact form was called $name
[/COLOR]
[COLOR=red]Their email address is $email
[/COLOR]
[COLOR=red]and their message is $message”;[/COLOR]
[COLOR=red]Mail ($emailto, $subject, $body, $headers);[/COLOR]
[COLOR=red]?>[/COLOR]
[COLOR=black]Any help would gladly be appreciated Cheers BondiBill[/COLOR]