dniezby
12-17-2006, 03:11 AM
It's for a eMail form. It used to work but for some reason, it's not working now...Let me rephrase, it does still send the eMail but it's not getting a returning variable, so it will go to the "Thank You" page.
I've looked over the code for hours and can't seem to get it to return the variable...What's weird is that I used this code for the contact form on http://www.nssclan.org and that one suddenly doesn't work either....It did the other day.
Could someone look over the code and see if there is something wrong with it? I wrote this code with Chris' help in when version 4 was out.
Here is the code in the frame of the form.
// Check for blank fields and submit
sendbutton.onRelease = function(){
if(fullname.text == ""||email.text==""||agree.text==""||lastname.text==""||dob.text==""||gbname.text==""||eseal.text==""){
// If any of the fields are blank
errormessage._x = 150;
errormessage.gotoAndPlay("go");
}else{
var result_lv = new LoadVars();
result_lv.onLoad = function(success){
if(success){
fullname.text="";
lastname.text="";
email.text="";
dob.text="";
gbname.text="";
eseal.text="";
agree.text="";
myresponse.text = result_lv.returnMe;
gotoAndPlay("thanks");
}else{
myresponse.text = "error"
unknown_error._x = 150;
unknown_error.gotoAndPlay("go");
}
}
}
// Send the Data
var send_lv = new LoadVars();
send_lv.action = "send";
send_lv.fullname = fullname.text;
send_lv.lastname = lastname.text;
send_lv.email = email.text;
send_lv.dob = dob.text;
send_lv.gbname = gbname.text;
send_lv.eseal = eseal.text;
send_lv.agree = agree.text;
send_lv.subject = subject.text;
send_lv.recipient = recipient.text;
send_lv.sendAndLoad("clanrequest.php",result_lv,"POST");
};
Here is the php code for reading the submission data, sending the email and sending reply back to my movie.
clanrequest.php
<?
$fullname = $_POST["fullname"];
$lastname = $_POST["lastname"];
$email_addy = $_POST["email"];
$dob = $_POST["dob"];
$gbname = $_POST["gbname"];
$eseal = $_POST["eseal"];
$agree = $_POST["agree"];
$subject = $_POST["subject"];
$recipient = $_POST["recipient"];
$action = $_POST["action"];
// Log the IP address of sender
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("m/d/Y H:i:s"); // Date the form was sent
if ($action == "send") {
mail ("$recipient","$subject",
"A visitor has requested to join your clan:\n
From: $lastname, $fullname
eMail: $email_addy
GB Name: $gbname
eSeal name: $eseal
DOB: $dob
$agree, I agree to the clan rules and code of conduct.
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
IP address: $ip
Date/Time: $date", "FROM:$email_addy") ;
}
echo "&returnMe=thanks";
?>
I've looked over the code for hours and can't seem to get it to return the variable...What's weird is that I used this code for the contact form on http://www.nssclan.org and that one suddenly doesn't work either....It did the other day.
Could someone look over the code and see if there is something wrong with it? I wrote this code with Chris' help in when version 4 was out.
Here is the code in the frame of the form.
// Check for blank fields and submit
sendbutton.onRelease = function(){
if(fullname.text == ""||email.text==""||agree.text==""||lastname.text==""||dob.text==""||gbname.text==""||eseal.text==""){
// If any of the fields are blank
errormessage._x = 150;
errormessage.gotoAndPlay("go");
}else{
var result_lv = new LoadVars();
result_lv.onLoad = function(success){
if(success){
fullname.text="";
lastname.text="";
email.text="";
dob.text="";
gbname.text="";
eseal.text="";
agree.text="";
myresponse.text = result_lv.returnMe;
gotoAndPlay("thanks");
}else{
myresponse.text = "error"
unknown_error._x = 150;
unknown_error.gotoAndPlay("go");
}
}
}
// Send the Data
var send_lv = new LoadVars();
send_lv.action = "send";
send_lv.fullname = fullname.text;
send_lv.lastname = lastname.text;
send_lv.email = email.text;
send_lv.dob = dob.text;
send_lv.gbname = gbname.text;
send_lv.eseal = eseal.text;
send_lv.agree = agree.text;
send_lv.subject = subject.text;
send_lv.recipient = recipient.text;
send_lv.sendAndLoad("clanrequest.php",result_lv,"POST");
};
Here is the php code for reading the submission data, sending the email and sending reply back to my movie.
clanrequest.php
<?
$fullname = $_POST["fullname"];
$lastname = $_POST["lastname"];
$email_addy = $_POST["email"];
$dob = $_POST["dob"];
$gbname = $_POST["gbname"];
$eseal = $_POST["eseal"];
$agree = $_POST["agree"];
$subject = $_POST["subject"];
$recipient = $_POST["recipient"];
$action = $_POST["action"];
// Log the IP address of sender
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("m/d/Y H:i:s"); // Date the form was sent
if ($action == "send") {
mail ("$recipient","$subject",
"A visitor has requested to join your clan:\n
From: $lastname, $fullname
eMail: $email_addy
GB Name: $gbname
eSeal name: $eseal
DOB: $dob
$agree, I agree to the clan rules and code of conduct.
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
IP address: $ip
Date/Time: $date", "FROM:$email_addy") ;
}
echo "&returnMe=thanks";
?>