
OK here's the code:
Send Button Code:
Code: Select all
this.sendbutton.addEventListener('click', bF.bind(this));
function bF() {
if ($('#ToName').val() == "") {
this.Status.text = "please enter a to name";
} else
if ($('#ToEmail').val() == "") {
this.Status.text = "please enter a to email";
} else
if ($('#FromName').val() == "") {
this.Status.text = "please enter a from name";
} else
if (FromEmail = "") {
Status = "Please enter your email address";
} else
if ($('#Greeting').val() == "") {
this.Status.text = "please enter a greeting";
} else
if ($('#IntroMessage').val() == "") {
this.Status.text = "please enter a message";
} else {
this.Status.text = "Sending Ecard - Please Hold";
/*actual send function should either go right here,
or just on the frame it's about to jump to*/
this.gotoAndStop(2);
}
}
*ToName, FromName, ToEmail, IntroMessage, Greeting = text input Components of the same instance names.
*FromEmail, Status, SelectEcard = dynamic text boxes, same instance name.
*This button just needs a function that loads SelectEcard php.
I originally used this in flash, but need some other solution:
Code: Select all
loadVariablesNum ("SendEcard.php", 0, "POST");
Code: Select all
<?
register_globals( 'NGPCFRES' );
$CreateEcard = date(U);
$filename = $CreateEcard.".txt";
$ToEmail = $_POST["ToEmail"];
$FromEmail = $_POST["FromEmail"];
$ToName = $_POST["ToName"];
$FromName = $_POST["FromName"];
$Greeting = $_POST["Greeting"];
$IntroMessage = $_POST["IntroMessage"];
$EndMessage = $_POST["EndMessage"];
$EcardSelect = $_POST["selected"];
$Today = (date ("l dS of F Y ( h:i:s A )",time()));
$Created = "Ecard Created on $Today";
$EcardNum = $_POST['EcardSelect'];
$EcardText = "ToName={$_POST['ToName']}&ToEmail={$_POST['ToEmail']}&FromName={$_POST['FromName']}&FromEmail={$_POST['FromEmail']}&Greeting={$_POST['Greeting']}&IntroMessage={$_POST['IntroMessage']}&Created={$_POST['Created']}&";
$fp = fopen( "dBText/$filename","w");
fwrite($fp, $EcardText, 10000);
fclose( $fp );
######Email Card########
## You can change the subject and the message part around.
## Make sure to change the Link as stated in the Tutorial.
## (Change from 'someSite' to your actual site - leave the rest the same
$ToSubject = "E-card from $FromName";
$Message = "$ToName,\nYou have recieved a Flash E-card from $FromName. \nClick the following link to view your card:\n\n http://www.MYSITE.net/SelectCard.php?EcardText=$CreateEcard&ENum=$EcardNum\n\n-----------------------------------\nHere is the message that was sent:\n$ToName,\n$Greeting\n$IntroMessage\n\n-$FromName\n\n\n-----------------------------------\nThis card was sent by Bunny and Panda\n\nMaking you smile a little more each time.";
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FromName." <".$FromEmail.">");
## This next line returns a success message to the movie.
print "_root.holder.Status=\n Copy the following link to view your card:\n http://www.MYSITE.net/SelectCard.php?EcardText=$CreateEcard%26ENum=$EcardNum\n";
function register_global_array( $sg ) {
Static $superGlobals = array(
'e' => '_ENV' ,
'g' => '_GET' ,
'p' => '_POST' ,
'c' => '_COOKIE' ,
'r' => '_REQUEST' ,
's' => '_SERVER' ,
'f' => '_FILES' ,
'n' => '_SESSION'
);
Global ${$superGlobals[$sg]};
foreach( ${$superGlobals[$sg]} as $key => $val ) {
$GLOBALS[$key] = $val;
}
}
function register_globals( $order = 'gpc' ) {
$_SERVER; //See Note Below
$_ENV;
$_REQUEST;
$order = str_split( strtolower( $order ) );
array_map( 'register_global_array' , $order );
}
?>
*Confused as to whether or not ToName, FromName etc... need to reflect the same format as used in my button's code
Code: Select all
($('#ToName').val()
Code: Select all
$ToName = $_POST["ToName"];
*The line "print root holder status" I'd like it to change it to print to a text input component called "Grab", and it's not located in holder anymore, it's just there in the base timeline.
The cards themselves used to use this code in Flash, so I'm only posting it to show you what it is I was doing back then, so I guess I need another way now:
Code: Select all
loadVariablesNum ("http://www.MySite.net/dBText/"+EcardText+".txt", 0);
Code: Select all
<HTML>
<HEAD>
<TITLE>Here's your Ecard - from Bunny & Panda E-Cards</TITLE>
<?
register_globals( 'NGPCFRES' );
function register_global_array( $sg ) {
Static $superGlobals = array(
'e' => '_ENV' ,
'g' => '_GET' ,
'p' => '_POST' ,
'c' => '_COOKIE' ,
'r' => '_REQUEST' ,
's' => '_SERVER' ,
'f' => '_FILES' ,
'n' => '_SESSION'
);
Global ${$superGlobals[$sg]};
foreach( ${$superGlobals[$sg]} as $key => $val ) {
$GLOBALS[$key] = $val;
}
}
function register_globals( $order = 'gpc' ) {
$_SERVER; //See Note Below
$_ENV;
$_REQUEST;
$order = str_split( strtolower( $order ) );
array_map( 'register_global_array' , $order );
}
switch ($_GET['ENum']) {
## Birthday Cards
case '1':
$goto = "ecards/birthdaycards/birthday1.html?EcardText=".$EcardText;
$Dimensions = "WIDTH=700 HEIGHT=564";
break;
case '2':
$goto = "ecards/birthdaycards/birthday2.html?EcardText=".$EcardText;
$Dimensions = "WIDTH=700 HEIGHT=564";
break;
}
?>
<?php
$url = 'http://www.MySite.net/images/wallpaper.png';
?>
</head>
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
<br>
<br>
<br>
<br>
<center>
<OBJECT
<? print "$Dimensions";?>>
<PARAM NAME=movie VALUE="<? print "$goto";?>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="<? print "$goto";?>" quality=high bgcolor=#FFFFFF <? print "$Dimensions";?></EMBED>
</OBJECT>
</center>
<style type="text/css">
body
{
background-image:url('<?php echo $url ?>');
}
</style>
</BODY>
</HTML>