-
since musicman is helping currently with email and php..
wanna take a look at mine? still no work as the other guy said
Code:
var sendData_lv:LoadVars = new LoadVars();
var receiveData_lv:LoadVars = new LoadVars();
var formValidated:Boolean;
var errorMessages:Array = new Array();
receiveData_lv.onLoad = function():Void{
trace(this.sent);
if(this.sent == "OK"){
message0_txt.text = "Thank you for your Request, I will be intouch with you shortly";
}else{
message0_txt.text = this.sent;
}
}
creditapp_btn.onRelease = function() {
//this clears the error text field if they have been populate previously
clearTextFields();
errorMessages.length = 0; //empty the array so next time the submit button is clicked the array is not already populated
formValidated = checkForm();
if (formValidated) {
//the form is valid and so now we can send details to our PHP file
//populate LoadVars object with the field values
sendData_lv.name = t1.text;
sendData_lv.name = t2.text;
sendData_lv.name = t3.text;
sendData_lv.request = t4.text;
//trace(sendData_lv.email);
//trace("valid");
sendData_lv.sendAndLoad("email1.php?ck="+new Date().getTime(), receiveData_lv);
} else {
//populate textfields with the error messages
for (var i = 0; i<errorMessages.length; i++) {
_root["message"+i+"_txt"].text = errorMessages[i];
trace(errorMessages[i]);
}
}
};
function checkForm():Boolean {
//check whether the name field is empty
if (t1.text == "") {
errorMessages.push("Please enter your name.");
}
if (t2.text == "") {
errorMessages.push("Please enter your middle name.");
}
if (t3.text == "") {
errorMessages.push("Please enter your last name");
}
//if at this point the array is empty i.e has length 0, then this in effect means the form has passed all checks
if (errorMessages.length == 0) {
return true;
} else {
return false;
}
PHP Code:
<?php
$firstname = $_POST['t1'];
$middlename = $_POST['t2'];
$lastname = $_POST['t3'];
$birthdate = $_POST['birthdate_txt'];
$subject = 'Request from your website';
$headers = "From: $name <$email>\n";
$headers .= "Reply-To: $name <$email>\n";
//ENTER YOUR EMAIL ADDRESS HERE
$to = 'wsmith@parkagencywest.com';
//---------------------------
$success = mail($to, $subject, $request, $headers);
if($success){
echo '&sent=OK';
}else{
echo '&sent=Error';
}
?>
www.parkagencywest.com
i need this to work in 2 sections, 1 under financing and 1 under contacts where the request form is. youll see in the financing secition ive gotten as far as having your default mail client pop up when clicking "send" but its a blank email i get...
musicman, if youre able to fix this i'll pay you the 50 bucks that i currently have offered in my other post. this is very important to me and im not a flash designer, just someone who fools with it and always wants to bite off more than i can chew
-
Hi,
I tried the form in contacts but it does not seem to send at all.
I will have a look at the other one later
Musicman
-
Originally Posted by Musicman
Hi,
I tried the form in contacts but it does not seem to send at all.
I will have a look at the other one later
Musicman
yea the contacts is not working at all, the only progress ive been able to make was under the other one and youll see when clicking that it brings up your email client but its a blank email. i dont really want it to bring up outlook express, i just want it to send to my email while skipping the whole bringing up outlook completely
-
Hi,
when I tried, and filled all the fields, nothing happened. Probably because there is no outlook-style porgram at all on the machine I used
Musicman
-
FK'n_dog
PHP expects t1, t2, t3
$firstname = $_POST['t1'];
$middlename = $_POST['t2'];
$lastname = $_POST['t3'];
you are trying to send variable name 3 times
sendData_lv.name = t1.text;
sendData_lv.name = t2.text;
sendData_lv.name = t3.text;
you need to change this to -
sendData_lv.t1 = t1.text;
sendData_lv.t2 = t2.text;
sendData_lv.t3 = t3.text;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|