Hi
I have a problem php recognising my flash variables, I am using textInput boxes from the components section.
This is my code:
// set some variables
//
mailform = "mailform.php";
confirm = "thank you a confirmation email has been sent to your email address.";
action = "send";
error1 = "valid email required";
error2 = "input required";
//
// and focus on variable fname
//
//
// validate email function
//
function validate(address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
//
// clear form
function clearform() {
name.text = "";
company.text = "";
number.text = "";
email.text = "";
from.text = "";
to.text = "";
weight.text = "";
}
// form check
//
function formcheck() {
if ((((email.text == null)) || (email.text.length<1)) || (email.text == "valid email required")) {
email.text = error1;
action = "";
}
if (!validate(email.text)) {
email.text = error1;
action = "";
}
if ((name.text == null) || (name.text == "")) {
name.text = error2;
action = "";
}
if ((company.text == null) || (company.text == "")) {
company.text = error2;
action = "";
}
if ((number.text == null) || (number.text == "")) {
number.text = error2;
action = "";
}
if ((from.text == null) || (from.text == "")) {
from.text = error2;
action = "";
}
if ((to.text == null) || (to.text == "")) {
to.text = error2;
action = "";
}
if ((weight.text == null) || (weight.text == "")) {
weight.text = error2;
action = "";
}
if ((validate(email.text)) && (email.text != error1) && (name.text != "") && (name.text != error2) && (company.text != "") && (company.text != error2) && (number.text != "") && (number.text != error2) && (from.text != "") && (from.text != error2) && (to.text != "") && (to.text != error2) && (weight.text != "") && (weight.text != error2)) {
action = "send";
loadVariablesNum(mailform, 0, "POST");
}
}
stop();
my php code is:
<?
$adminaddress = "info@nicktoye.co.uk";
$siteaddress ="http://www.keepcouriers.co.uk";
$sitename = "Keep Couriers";
//No need to change anything below ...
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");
// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email.text'] ;
$name = $HTTP_POST_VARS['name'] ;
$company = $HTTP_POST_VARS['company.text'] ;
$number = $HTTP_POST_VARS['number.text'] ;
$from = $HTTP_POST_VARS['from.text'] ;
$to = $HTTP_POST_VARS['to.text'] ;
$weight = $HTTP_POST_VARS['weight.text'] ;
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action == "send") {
//
mail ("$adminaddress","Info Request",
"A visitor at $sitename has left the following information
Name: $name
Email: $email
The visitor commented:
------------------------------
From: $company
Contact Me On $number
I want a quote for delivering a parcel $from
to $to
at an approximate weight of $weight
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress" ) ;
//This sends a confirmation to your visitor
mail ("$email","Thank You for visiting $sitename",
"Hi $name,
Thank you for your interest in $sitename!
Cheers,
$sitename
$siteaddress","FROM:$adminaddress") ;
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you. You will receive a confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
} //
?>
Many thanks in advance