Asparagus
08-18-2004, 12:51 AM
As quickly and simply as I can, I'll explain...
WHAT IS IT: A mailing list, where the user enters NAME & EMAIL and, with the use of radio-type buttons, they can chose the format of the newsletter (PLAIN TEXT or RICH TEXT) and also the language (ENGLISH or DANISH).
WHAT IS WRONG: Doesn't forward the info to the owner, but does send a confirmation email to the user (but not all users??).
WHY: I don't know, that's why I'm here. Please help!
WHO: You! Any help wil be greeeeeeeeeaaaaaaaaatly appreciated
CODES WITHIN THE .FLA:
Frame1:fscommand ("allowscale", "false");
//
// set some variables
//
mailform = "mailinglist.php";
confirm = "please wait for confirmation ...";
action = "send";
//
// and focus on variable fname
//
Selection.setFocus("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);
}
//
// form check
//
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "Address not valid...")) {
email = "Address not valid...";
action = "";
}
if (!validate(email)) {
email = "Address not valid...";
action = "";
}
if (fname == null) {
fname = "Name required...";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();Frame5:loadVariablesNum(mailform, 2);
answer = confirm;
On the 'Subcribe' button:on (release) {
formcheck();
trace('language '+lang+'\nformat '+format+'\nemail '+email);
}And here's the .PHP script:<?
// Enter your contact email address here
$adminaddress = "XXXXX@XXXXX.com";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.XXXXX.com";
// Enter your company name or site name here
$sitename = "XXXXX";
/************************************************** *****
No need to change anything below unless you want to add or subtract functions or change the wording of things sent back to the flash file ...
************************************************** *****/
// 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);
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","New Subscription",
"A visitor at $sitename subscribed to your mailing list.\n
Name: $name
Email: $email
Language: $lang
Format: $format
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","XXXXX",
"Hej $name,\n
Du er nu med på mailinglisten tilhørende XXXXX.
Tak,
$sitename
$siteaddress
----------------------
Hi $name,\n
You have now joined the mailinglist belonging to XXXXX.
Thank you,
$sitename
$siteaddress","FROM:$adminaddress");
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thanks for joining XXXX
mailing list. You will receive a
confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";
endif;
?>
WHAT IS IT: A mailing list, where the user enters NAME & EMAIL and, with the use of radio-type buttons, they can chose the format of the newsletter (PLAIN TEXT or RICH TEXT) and also the language (ENGLISH or DANISH).
WHAT IS WRONG: Doesn't forward the info to the owner, but does send a confirmation email to the user (but not all users??).
WHY: I don't know, that's why I'm here. Please help!
WHO: You! Any help wil be greeeeeeeeeaaaaaaaaatly appreciated
CODES WITHIN THE .FLA:
Frame1:fscommand ("allowscale", "false");
//
// set some variables
//
mailform = "mailinglist.php";
confirm = "please wait for confirmation ...";
action = "send";
//
// and focus on variable fname
//
Selection.setFocus("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);
}
//
// form check
//
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "Address not valid...")) {
email = "Address not valid...";
action = "";
}
if (!validate(email)) {
email = "Address not valid...";
action = "";
}
if (fname == null) {
fname = "Name required...";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();Frame5:loadVariablesNum(mailform, 2);
answer = confirm;
On the 'Subcribe' button:on (release) {
formcheck();
trace('language '+lang+'\nformat '+format+'\nemail '+email);
}And here's the .PHP script:<?
// Enter your contact email address here
$adminaddress = "XXXXX@XXXXX.com";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.XXXXX.com";
// Enter your company name or site name here
$sitename = "XXXXX";
/************************************************** *****
No need to change anything below unless you want to add or subtract functions or change the wording of things sent back to the flash file ...
************************************************** *****/
// 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);
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","New Subscription",
"A visitor at $sitename subscribed to your mailing list.\n
Name: $name
Email: $email
Language: $lang
Format: $format
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","XXXXX",
"Hej $name,\n
Du er nu med på mailinglisten tilhørende XXXXX.
Tak,
$sitename
$siteaddress
----------------------
Hi $name,\n
You have now joined the mailinglist belonging to XXXXX.
Thank you,
$sitename
$siteaddress","FROM:$adminaddress");
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thanks for joining XXXX
mailing list. You will receive a
confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";
endif;
?>