Highlighted

Repost - requesting ONLY copy/paste solution for my php mailer (please no suggestions, I'm dumb).

Explorer ,
Feb 11, 2020

Copy link to clipboard

Copied

Hi again, waited a few weeks to see if the fish would bite. Sadly none 😞 So I'll go ahead and repost an old topic, but this time I'd like to request for a solution that I can copy/paste only... No suggestions please, as the topic title states, I very dumb and have no idea how to look at terms like "urlloader" and know how to use them. I tried researching a few things all this time, did LOTS of testing... aaaand ended up with no solution 😞  so here we go...


Main Question: If I can't use this php mailer anymore, I'd like to consider an alternative. I might simply ditch the e-mail function and just have it generate a grabbable link that users can copy/paste into their social media/messenger. Might that make things easier for those who would help me? Might I have to abandon this old php code and do something different? Well, in that case, let's semi-start-from-scratch.


Simply take a look at my code below, see what can be salvaged and see if a new engine can be created:

Button for sending (would like it to have the ability to actually send submitted data):

 

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";
//* originally used loadVariablesNum ("SendEcard.php", 0, "POST");
		this.gotoAndStop(2);
	}
}

 

References:

*ToName, FromName, ToEmail, IntroMessage, Greeting = component text input with instance names of the same.
*FromEmail, Status, EcardSelect = dynamic text fields with instance names of the same.

*Originally used this in Flash, told to replace with ajas or load, somehow:

 

loadVariablesNum ("SendEcard.php", 0, "POST");

 

**In the case I drop the email function, I will drop ToEmail and FromEmail

 

 

SendEcard php file:

 

<? 
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 );
}
?>

 

*I'm not sure if I have to type ToEmail and FromEmail differently in the above code because in my send button, they appear differently because one is dynamic text and the other is component: 

 

//* uses $ and #
if ($('#FromName').val() == "")

//* just uses instance name
if (FromEmail = "")

 

*The following line need to change. I don't want it to go to Status. I want it to go to a new text input component that I've named Grab, and it is not located in holder. It's simply there in the base timeline:

 

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";

 

 

 

The result of sending created an url like this:

 

http://www.mysite.net/SelectCard.php?EcardText=1577837753&ENum=1

 

The ecard itself had this code and use the plus ecardtext plus to grab the EcardText numbers from the url to open the correct txt file.

 

loadVariablesNum ("http://www.MySite.net/dBText/"+EcardText+".txt", 0);

 

The canvas equivalent (most mentioned using ajax or load) has to be able to get those numbers in the same way and grab the randomly numbered text files (or JS files depending on your solution?)...

 

SelectEcard php file:

 

<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>

 

 *This seems to be working to some extent. It shows the embedded animation. I don't think this needs to be changed, but take a look anyway.

Much thanks to anyone who contributes their time to helping me get this up and running. I know it's a headache (as much as the OP), I can't see myself just letting this project die out. Best wishes. Thank you all!

TOPICS
Code

Views

208

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Repost - requesting ONLY copy/paste solution for my php mailer (please no suggestions, I'm dumb).

Explorer ,
Feb 11, 2020

Copy link to clipboard

Copied

Hi again, waited a few weeks to see if the fish would bite. Sadly none 😞 So I'll go ahead and repost an old topic, but this time I'd like to request for a solution that I can copy/paste only... No suggestions please, as the topic title states, I very dumb and have no idea how to look at terms like "urlloader" and know how to use them. I tried researching a few things all this time, did LOTS of testing... aaaand ended up with no solution 😞  so here we go...


Main Question: If I can't use this php mailer anymore, I'd like to consider an alternative. I might simply ditch the e-mail function and just have it generate a grabbable link that users can copy/paste into their social media/messenger. Might that make things easier for those who would help me? Might I have to abandon this old php code and do something different? Well, in that case, let's semi-start-from-scratch.


Simply take a look at my code below, see what can be salvaged and see if a new engine can be created:

Button for sending (would like it to have the ability to actually send submitted data):

 

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";
//* originally used loadVariablesNum ("SendEcard.php", 0, "POST");
		this.gotoAndStop(2);
	}
}

 

References:

*ToName, FromName, ToEmail, IntroMessage, Greeting = component text input with instance names of the same.
*FromEmail, Status, EcardSelect = dynamic text fields with instance names of the same.

*Originally used this in Flash, told to replace with ajas or load, somehow:

 

loadVariablesNum ("SendEcard.php", 0, "POST");

 

**In the case I drop the email function, I will drop ToEmail and FromEmail

 

 

SendEcard php file:

 

<? 
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 );
}
?>

 

*I'm not sure if I have to type ToEmail and FromEmail differently in the above code because in my send button, they appear differently because one is dynamic text and the other is component: 

 

//* uses $ and #
if ($('#FromName').val() == "")

//* just uses instance name
if (FromEmail = "")

 

*The following line need to change. I don't want it to go to Status. I want it to go to a new text input component that I've named Grab, and it is not located in holder. It's simply there in the base timeline:

 

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";

 

 

 

The result of sending created an url like this:

 

http://www.mysite.net/SelectCard.php?EcardText=1577837753&ENum=1

 

The ecard itself had this code and use the plus ecardtext plus to grab the EcardText numbers from the url to open the correct txt file.

 

loadVariablesNum ("http://www.MySite.net/dBText/"+EcardText+".txt", 0);

 

The canvas equivalent (most mentioned using ajax or load) has to be able to get those numbers in the same way and grab the randomly numbered text files (or JS files depending on your solution?)...

 

SelectEcard php file:

 

<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>

 

 *This seems to be working to some extent. It shows the embedded animation. I don't think this needs to be changed, but take a look anyway.

Much thanks to anyone who contributes their time to helping me get this up and running. I know it's a headache (as much as the OP), I can't see myself just letting this project die out. Best wishes. Thank you all!

TOPICS
Code

Views

209

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 11, 2020 0
ClayUUID LATEST
Adobe Community Professional ,
Feb 11, 2020

Copy link to clipboard

Copied

You know this isn't a PHP forum, yes? You'd be far better off asking this sort of question somewhere like Stack Exchange.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 11, 2020 0