View Single Post

  #2 (permalink)  
Old 15-02-08, 11:06
tem's Avatar
tem tem is offline
Moderator
 
Join Date: Jan 1970
Posts: 466
Rep Power: 39
tem is on a distinguished road
Re: Flash CS3 email form AS2

Hi!
I've noticed a similar problem while working in a clip in as2
you should try to write the code that talks to the php in the main timeline..

Code:
mailform = "form.php";
confirm = "please wait for confirmation ..."
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
wait frame:
Code:
loadVariablesNum(mailform, 0);
answer = confirm;
then after wait create a frame called loop:
Code:
if (answer != confirm) {
    gotoAndStop ("done");
}
and a frame that "loops" with it
Code:
gotoAndPlay("loop");
after this a frame called done where you can place a dynamic textfield tracing the variable answer.

here you got the php file:
Code:

/******************************************************

**

**   tConcept Php Mailer 0.9   

**

**    Based on BigJolt Php mailer 2.0

**    07/26/2007

**    Special Thanks to Onsitus and the Masterdrive comunity

**   

*******************************************************/



/******************************************************* 



site details below!



*******************************************************/



// Enter your contact email address: administrator address 

$adminaddress = "info@mysite.com"; 



// Enter the address of your website here include http://www. 

$siteaddress ="http://www.mycoolsite.com"; 



// Enter your site name  

$sitename = "My Cool Site"; 



/*******************************************************



Don't change anything below...



*******************************************************/



// 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","Info request",

"A visitor at $sitename has left the following information\n

Nome: $fname

Cognome: $lname

Indirizzo: $indir 

Email: $email

Telefono: $telno


The visitor commented:

------------------------------

$comments



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","$sitename", 

"Grazie per essersi iscritto a $sitename!\n

La terremo aggiornata sulle prossime iniziative.

Distinti saluti,

$sitename

$siteaddress","FROM:$adminaddress"); 



//Confirmation is sent back to the Flash form that the process is complete

$sendresult = "Iscrizione avvenuta con successo. Grazie! ";

$send_answer = "answer=";

$send_answer .= rawurlencode($sendresult);

echo "$send_answer";



endif;
__________________
http://www.thetconcept.com
Reply With Quote