PDA

View Full Version : is there anything wrong with my code


KingCHAD
12-19-2004, 03:53 PM
:confused: I am trying to create a dynamic form in flash which has input text fields and some different components....

Here are my forms Click Here (http://obscuradesign.co.uk/colingrazierhotel/form.htm)

In the first key frame i have :

mailform = "bookform.php";
action = "";
twin = checkbox.getValue()
double = checkbox.getValue()
single = checkbox.getValue()
family = checkbox.getValue()
twinqnty = numericstepper.getValue()
doubleqnty = numericstepper.getValue()
singleqnty = numericstepper.getValue()
familyqnty = numericstepper.getValue()
datefrom = datefield.getValue()
dateto = datefield.getValue()
stop();

and on the submit button I have :

on (press) {
twin = checkbox.getValue()
double = checkbox.getValue()
single = checkbox.getValue()
family = checkbox.getValue()
twinqnty = numericstepper.getValue()
doubleqnty = numericstepper.getValue()
singleqnty = numericstepper.getValue()
familyqnty = numericstepper.getValue()
datefrom = datefield.getValue()
dateto = datefield.getValue()
trace(twin)
trace(double)
trace(single)
trace(family)
trace(twinqnty)
trace(doubleqnty)
trace(singleqnty)
trace(familyqnty)
trace(datefrom)
trace(dateto)
}
on (release) {
if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
action = "Send";
loadVariablesNum("bookform.php", 0, "POST");
gotoAndPlay("booked");
} else {
vemail = "Please enter email";
action = "";
stop();
}
}



now in the php file i have :

<?
// Enter your email address here
$adminaddress = "craig@obscuradesign.co.uk";

// Enter the address of your website here MUST include http://www.
$siteaddress ="http://www.obscuradesign.co.uk/colingrazierhotel";

// Enter your company name or site name here
$sitename = "Colin Grazier Hotel";

// Gets the date and time from your server
$date = date("11/20/2004 H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);

//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
IF ($action != ""):
mail("$adminaddress","Online Booking Form",
"FAO: Bookings @ $sitename \n
Name: $name
Address1: $add1
Address2: $add2
Town/City: $town
Postcode: $post
Telephone: $tel
Email: $email
Type of Hire: $type
Date From: $datefrom
Date To: $dateto
Enquiry: $enquiry
Twin Room: $twin
Double Room: $double
Single Room: $single
Family Room: $family
Twin Room Quantity: $twinqnty
Double Room Quantity: $doubleqnty
Single Room Quantity: $singleqnty
Family Room Quantity: $familyqnty
\n

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("$vemail","Thank You for visiting $sitename", "Hi $fname,\n
Thank you for your interest in $sitename!\n
Cheers,
$sitename
$siteaddress","FROM:$adminaddress");

//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Done!";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";

ENDIF;
?>

Alot of this code i have been given and dont really understand any of it, but the form seems to send and I get an email that shows this :

FAO: Bookings @ Colin Grazier Hotel

Name: craig
Address1: vxcvzxcb
Address2: kdfd
Town/City: txfb
Postcode: xfbfxc
Telephone: 012356789
Email: chaddesigns@hotmail.com
Type of Hire: undefined
Date From: undefined
Date To: undefined
Enquiry: just need this to work
Twin Room: undefined
Double Room: undefined
Single Room: undefined
Family Room: undefined
Twin Room Quantity: undefined
Double Room Quantity: undefined
Single Room Quantity: undefined
Family Room Quantity: undefined



Logged Info :
------------------------------
Using: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Hostname: brhm-cache-6.server.ntli.net
IP address: 62.255.32.14
Date/Time: 11/20/2004 15:35:44