PDA

View Full Version : booking page not going to "thank you" screen...


Denise032
09-21-2007, 02:16 AM
I have a booking page set up on this site: http://www.oasisbanddc.com

It's 100% functional, meaning I receive the emails and all the content. The issue is that after the user clicks the send button, the page just sits still rather than going to the "thank you" message...

send btn code
on (release) {
var sendLV:LoadVars = new LoadVars();
sendLV.name = name;
sendLV.phone = phone;
sendLV.cellPhone = cellPhone;
sendLV.emailbk = emailbk;
sendLV.month = monthin.selectedItem.label;
sendLV.date = datein.selectedItem.label;
sendLV.year = yearin.selectedItem.label;
sendLV.month2 = monthin2.selectedItem.label;
sendLV.date2 = datein2.selectedItem.label;
sendLV.year2 = yearin2.selectedItem.label;
sendLV.locationin = locationin.selectedItem.label;
sendLV.typein = typein.selectedItem.label;
sendLV.musictypein = musictypein.selectedItem.label;
sendLV.guestnum = guestnum.selectedItem.label;
sendLV.timefrom = timefrom.selectedItem.label;
sendLV.timeto = timeto.selectedItem.label;
sendLV.street1 = street1;
sendLV.street2 = street2;
sendLV.city = city;
sendLV.statein = statein.selectedItem.label;
sendLV.zipcode = zipcode;
sendLV.message = message;
sendLV.sendAndLoad("email.php", sendLV, "post");
sendLV.onLoad = function(success) {
if (success) {
trace("file loaded");
if (this.mailSent == "ok") {
_root.gotoAndStop(3);
} else {
trace("mail could not be sent!");
}
} else {
trace("couldn't load the file");
}
};
}


and, obviously, on frame three is a message that says:
Your email has been sent.
You will be contacted via phone and/or email as soon as possible.
Thank You!

Denise032
09-22-2007, 06:20 AM
I also wanted to mention that on the output window I am getting the following message:

file loaded
mail could not be sent!

CyanBlue
09-22-2007, 07:16 PM
Howdy and Welcome... :)

That sounds like your PHP script was not able to send an email for some reason... Can you think of the reason why PHP is not able to do so???

Denise032
09-22-2007, 07:29 PM
Thank you very much for your reply. I have tested numerous times on different machines and the email is going thru just fine. My issue is that the "thank you" page is not coming up. Any reason as to why that might be?

CyanBlue
09-22-2007, 07:32 PM
That 'mail could not be sent!' message should be displaying only when PHP says otherwise according to your code, but you are saying that you were able to send an email with no problem... I'm abit confused...

Denise032
09-22-2007, 07:39 PM
That's kinda what's confusing me too...It won't send when I try it on my computer and I get that output screen.

HOWEVER...

When I test it on the web, everything is fine, except it won't go to the thank you page.

CyanBlue
09-22-2007, 08:08 PM
You should NOT test that within the Flash IDE... Flash IDE only simulates GET not POST...

Denise032
09-22-2007, 09:55 PM
OK thanks...that makes sense now... but back to my original question... why is it not going to frame 3 to show the "thank you" message?

CyanBlue
09-23-2007, 01:13 AM
Your script says that you are going to frame 3 only when this if statement is correct... and my only guess is that PHP is giving you other value than 'ok' for that transaction... So, check your PHP script...
if (this.mailSent == "ok") {

Denise032
09-23-2007, 05:07 AM
Hmm... it seems to match up fine, but maybe I am missing something. Here is what I have in my php code...


<?php

$sendTo = "denise032@yahoo.com";
$subject = "Booking Request - www.oasisbanddc.com";

$headers = "From: " . $_POST["name"];
$headers .= " <" . $_POST["emailbk"] .">" . "\r\n";
$headers .= "Reply-To: " . $_POST["emailbk"] . "\r\n";
$headers .= "Return-path: " . $_POST["emailbk"];

$message = "Name: " . $_POST["name"] ."\r\n";
$message .= "E-mail: " . $_POST["emailbk"] ."\r\n";
$message .= "Phone: " . $_POST["phone"] ."\r\n";
$message .= "Cellphone: " . $_POST["cellPhone"] ."\r\n";
$message .= "Booking date: " . $_POST["month"] . "/" . $_POST["date"] . "/" . $_POST["year"] ."\r\n";
$message .= "Alternative Booking date: " . $_POST["month2"] . "/" . $_POST["date2"] . "/" . $_POST["year2"] ."\r\n";
$message .= "Location: " . $_POST["locationin"] . "\r\n";
$message .= "Number of Guests: " . $_POST["guestnum"] . "\r\n";
$message .= "Type of Event: " . $_POST["typein"] . "\r\n";
$message .= "Music Type: " . $_POST["musictypein"] . "\r\n";
$message .= "Booking time: " . $_POST["timefrom"] . " - " . $_POST["timeto"] . "\r\n";
$message .= "Address: " . $_POST["street1"] . "\r\n" . $_POST["street2"] ."\r\n" . $_POST["city"] . ", " . $_POST["statein"] . ", " . $_POST["zipcode"] . "\r\n";
$message .= "Message: " . $_POST["message"];


if(mail($sendTo, $subject, $message, $headers)) {
echo "&mailSent=ok&";
} else {
echo "&mailSent=problem&";
}

?>

Denise032
09-23-2007, 05:24 AM
OK, nevermind, I feel so dumb!! I just figured it out myself! The thank you message was in the same mc as my send btn, therefore, all I needed to do was change the following:

_root.gotoAndStop(3); to gotoAndStop(3);


What happend was, I had a very similar form on another one of my sites, so I decided to take a shortcut and copy and paste the code.


Thank you very very much CyanBlue for all your replies! :-)

CyanBlue
09-24-2007, 12:21 PM
Glad to hear that you've figured it out... ;)