Hi, I was hoping for some help with something I just cannot get my head around (and I am a newbie with this stuff).
I have a contact form in flash that I want somebody to fill out their name, email, subject, and message and then email it to me.
I have tried the following in php (I have removed my email):
[COLOR=Navy]<?php
$email = $_REQUEST[‘sender_email’] ;
$message = $_REQUEST[‘sender_message’] ;
$subject = $_REQUEST[‘sender_subject’] ;
$name = $_REQUEST[‘sender_name’] ;
mail( "xxxxx@gmail.com", “Most Unexpected Enquiry”,
$message, “From: $email” );
?>. [/COLOR]
and then the following on the send button:
[COLOR=Navy]
on (release) {
// Now import the variables we
// need to send in this movie clip
sender_mail = _root.Semail.text
sender_name = _root.Sname.text
sender_subject = _root.Ssubject.text
sender_message = _root.Smessage.text
// all the vars we just imported
// will be sent via POST method now
loadVariables(“http://www.xxxxx.com/public_html/sendmail.php",this,"POST”);
// and when receives the answer from
// the server…
this.onData = function()
{
for(var a in this) trace([a,this[a]])
// ok, next frame
_root.nextFrame();
if(this.output==‘sent’)
{
// in case of success
_root.errTitle = ‘Thank You.’;
_root.errType = “Your message has been succesfully sent.”;
} else {
// else
_root.errTitle = “Error!”;
_root.errType = “Attention, an error occurred while processing your message. Please try again later.”;
}
}
}[/COLOR]
None of this stuff is my doing, but I just cant get it to do anything. At one point it sent me an email that just said “undefined”, but since messing about nothing since. One thing I think it may be is that the php file cannot be found. If the swf file and php are next to each other on the server, what url would I need?
Any help will be greatly appreciated
Paul