Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ecard Doesn't Mail To Recipient

Status
Not open for further replies.

keen01

MIS
Nov 16, 2004
73
US
I had used this script by Jeff Hill years ago for a Flash ECard. It used to work. I was going to make some new animations and put this back up but it doesn't email the card to the recipient? Has the language changed?
A file does get put into the dBText folder, but all it says is

ToName=&ToEmail=&FromName=&FromEmail=&Greeting=&IntroMessage=&Created=Ecard Created on Thursday 06th 2011f October 2011 ( 11:10:42 AM ).

I think it's supposed to display the info for ToName and so on?

And after hitting send, the flash file does display Success your Card Has Been Sent! which is sent back by the PHP script. So it is recognizing it and kind of working?

The script is as follows

<?

$CreateEcard = date(U);

$filename = $CreateEcard.".txt";

$ToName = stripslashes($ToName);
$FromName = stripslashes($FromName);
$Greeting = stripslashes($Greeting);
$IntroMessage = stripslashes($IntroMessage);
$EndMessage = stripslashes($EndMessage);

$Today = (date ("l dS of F Y ( h:i:s A )",time()));

$Created="Ecard Created on $Today";

$EcardNum = $EcardSelect;

$EcardText = "ToName=$ToName&ToEmail=$ToEmail&FromName=$FromName&FromEmail=$FromEmail&Greeting=$Greeting&IntroMessage=$IntroMessage&Created=$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 = "You have recieved a Flash Ecard from $FromName";
$Message = "$ToName,\nYou have recieved a Flash card from $FromName. \nClick the following link to view your card:\n\n is the message that was sent:\n$ToName,\n$Greeting\n$IntroMessage\n\n-$FromName\n\n\n-----------------------------------\nThis card was sent from Flash-dB Team.";


###################
## This line actually sends the email - you should not have to change this.

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FromName." <".$FromEmail.">");


## This next line returns a success message to the movie.
print "_root.Status=Success your Card Has Been Sent!";

#### End #########
## By: Jeffrey F. Hill
##
?>
 
not the language, so much as the defaults have changed.

assuming your form uses the POST method then change this block as follows

Code:
$ToName = stripslashes($ToName);
$FromName = stripslashes($FromName);
$Greeting = stripslashes($Greeting);
$IntroMessage = stripslashes($IntroMessage);
$EndMessage = stripslashes($EndMessage);
to
Code:
$fields = array('ToName', 'FromName', 'Greeting', IntroMessage', 'EndMessage');
foreach ($fields as $field): 
  if (isset($_POST[$field])):
    $$field = get_magic_quotes_gpc() ? stripslashes(trim($_POST[$field])) : trim ($_POST[$field]);
  else:
    $$field = '';
  endif;
endforeach;

all should then start working again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top