Clark Wells
10-17-2008, 09:55 PM
I have just completed building a flash website that contains a contact form. Everything is working perfectly with the form except 1 thing... Whenever i recieve the email it still contains the Array Field Descriptions, and lists them after the actual content. So if i was to fill out the form with this information,
Name Field: John Johnson
Email Field: John@johnson.com
Subject Field: This is the subject
Message Field: this is the message
It would display it in my email like this:
Name:
John JohnsonYour Name:
--------------------------------------------------------------------------------------------------------
Email:
John@Johnson.comYour Email:
--------------------------------------------------------------------------------------------------------
Subject:
This is the SubjectSubject:
--------------------------------------------------------------------------------------------------------
Message:
This is the MessageMessage:
--------------------------------------------------------------------------------------------------------
See how it still contains the Flash forms Field descriptions??? and lists it after the actual content?? I just want them taken out and cant figure out how.
Here Is my Action Script for the Frame:
rec="ice@template-help.com";
serv="php";
var fields_descriptions= Array ("",
Array("t1", "name", "Your Name"),
Array("t2", "email", "Your Email:"),
Array("t3", "subject", "Subject:"),
Array("t4", "message", "Message:"),
);
function reset_txt(name,name2,value) {
path=eval(_target);
path[name2]=value;
this[name].onSetFocus=function() {
path=eval(_target);
if(path[name2]==value) { path[name2]="";}
}
this[name].onKillFocus=function() {
path=eval(_target);
if(path[name2]=="") { path[name2]=value;}
}
}
for (i=1; i<=fields_descriptions.length; i++) {
reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
}
Here is the Code with the Submit Button:
on (rollOver) {
this.gotoAndPlay("s1");
}
on(rollOut, releaseOutside) {;
this.gotoAndPlay(this._totalframes-this._currentframe);
}
on (release) {
for (i=1; i<_parent.fields_descriptions.length; i++) {
if (_parent[_parent.fields_descriptions[i][1]] != _parent.fields_descriptions[i][2]) {
this[_parent.fields_descriptions[i][1]] = _parent[_parent.fields_descriptions[i][1]]+_parent.fields_descriptions[i][2];
}
_parent.reset_txt(_parent["t"+i],_parent.fields_descriptions[i][1],_parent.fields_descriptions[i][2]);
}
this.recipient = _parent.rec;
//i=undefined;
getURL("contact."+_parent.serv, "_blank", "POST");
}
And here is my PHP Code:
<?PHP
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]);
}
next($_REQUEST);
}
reset($post_vars);
$to="myemail@email.com";
$subject="Email from your website";
$message ="Name:\n\n ".$_POST['name'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$message .="Email:\n\n ". $_POST['email'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$message .="Subject:\n\n ". $_POST['subject'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$message .="Message:\n\n ". $_POST['message'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$headers .="From: $name";
$headers .="Reply-To: $email";
$sentOk=mail($to,$subject,$message,$headers);
echo "Your Message has been Sent!" . $sentOK;
?>
Like i said, everything is working brilliantly except for that... There has got to be some way that i can remove those "Arrays"... I tried "Unset" but didn't have any luck.... PLEASE RESCUE ME!!!!!!
if you want to view the form online, it is on my website, http://www.clarkwells.com. Just go there and then click on "Contact Clark"
Name Field: John Johnson
Email Field: John@johnson.com
Subject Field: This is the subject
Message Field: this is the message
It would display it in my email like this:
Name:
John JohnsonYour Name:
--------------------------------------------------------------------------------------------------------
Email:
John@Johnson.comYour Email:
--------------------------------------------------------------------------------------------------------
Subject:
This is the SubjectSubject:
--------------------------------------------------------------------------------------------------------
Message:
This is the MessageMessage:
--------------------------------------------------------------------------------------------------------
See how it still contains the Flash forms Field descriptions??? and lists it after the actual content?? I just want them taken out and cant figure out how.
Here Is my Action Script for the Frame:
rec="ice@template-help.com";
serv="php";
var fields_descriptions= Array ("",
Array("t1", "name", "Your Name"),
Array("t2", "email", "Your Email:"),
Array("t3", "subject", "Subject:"),
Array("t4", "message", "Message:"),
);
function reset_txt(name,name2,value) {
path=eval(_target);
path[name2]=value;
this[name].onSetFocus=function() {
path=eval(_target);
if(path[name2]==value) { path[name2]="";}
}
this[name].onKillFocus=function() {
path=eval(_target);
if(path[name2]=="") { path[name2]=value;}
}
}
for (i=1; i<=fields_descriptions.length; i++) {
reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
}
Here is the Code with the Submit Button:
on (rollOver) {
this.gotoAndPlay("s1");
}
on(rollOut, releaseOutside) {;
this.gotoAndPlay(this._totalframes-this._currentframe);
}
on (release) {
for (i=1; i<_parent.fields_descriptions.length; i++) {
if (_parent[_parent.fields_descriptions[i][1]] != _parent.fields_descriptions[i][2]) {
this[_parent.fields_descriptions[i][1]] = _parent[_parent.fields_descriptions[i][1]]+_parent.fields_descriptions[i][2];
}
_parent.reset_txt(_parent["t"+i],_parent.fields_descriptions[i][1],_parent.fields_descriptions[i][2]);
}
this.recipient = _parent.rec;
//i=undefined;
getURL("contact."+_parent.serv, "_blank", "POST");
}
And here is my PHP Code:
<?PHP
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]);
}
next($_REQUEST);
}
reset($post_vars);
$to="myemail@email.com";
$subject="Email from your website";
$message ="Name:\n\n ".$_POST['name'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$message .="Email:\n\n ". $_POST['email'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$message .="Subject:\n\n ". $_POST['subject'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$message .="Message:\n\n ". $_POST['message'];
$message .="\n\n--------------------------------------------------------------------------------------------------------\n";
$headers .="From: $name";
$headers .="Reply-To: $email";
$sentOk=mail($to,$subject,$message,$headers);
echo "Your Message has been Sent!" . $sentOK;
?>
Like i said, everything is working brilliantly except for that... There has got to be some way that i can remove those "Arrays"... I tried "Unset" but didn't have any luck.... PLEASE RESCUE ME!!!!!!
if you want to view the form online, it is on my website, http://www.clarkwells.com. Just go there and then click on "Contact Clark"