Welcome, Guest. Please login or register.
Did you miss your activation email?
02/04/12, 00:37
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Recent Tutorial Support
| |-+  Flash Ecards (Moderators: Flash-db, vesa kortelainen, Ronald Wernecke, Mohsin Sumar, Jorge Solis)
| | |-+  Use this code if your Server is running php 4.1.0 or newer
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 Print
Author Topic: Use this code if your Server is running php 4.1.0 or newer  (Read 28482 times)
Arclave
Server what's that
*
Posts: 22


Americanism is Live and Kicking at www.rwyouth.com


View Profile WWW
« on: 12/03/03, 13:06 »

SendEcard.php should be like this:

<?

$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["EcardSelect"];

$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 http://www.rwyouth.com/Ecards/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 from www.flash-db.com/Ecards/\n\nThe 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
## www.flash-db.com

?>
Logged
Arclave
Server what's that
*
Posts: 22


Americanism is Live and Kicking at www.rwyouth.com


View Profile WWW
« Reply #1 on: 12/03/03, 13:07 »

SelectCard.php be should be like this:


<HTML>
<HEAD>

<TITLE>Here's your Flash Ecard - from the Flash-dB.com Tutorial</TITLE>

<?
$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];

switch ($ENum) {

   case '1':
   $goto = "Ecard1.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '2':
   $goto = "Ecard2.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '3':
   $goto = "Ecard3.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=3";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '4':
   $goto = "Ecard4.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=4";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '5':
   $goto = "Ecard5.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=5";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;
}

?>
</head>

<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">

<center>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
<? 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";?> TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
<? print "$DimensionsFooter";?>>
<PARAM NAME=movie VALUE="<? print "$gotoFooter";?>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="<? print "$gotoFooter";?>" quality=high bgcolor=#FFFFFF  <? print "$DimensionsFooter";?> TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</center>
</BODY>
</HTML>
Logged
Arclave
Server what's that
*
Posts: 22


Americanism is Live and Kicking at www.rwyouth.com


View Profile WWW
« Reply #2 on: 12/03/03, 13:10 »

the $_POST and $_GET have to be used in 4.1.0 or later to gather data from forms and query strings respectively.


Thanks for your help FLASH-DB

Gene
« Last Edit: 12/03/03, 13:10 by Gene Ritter » Logged
vesa kortelainen
Administrator
Systems Administrator
*****
Posts: 3450


View Profile
« Reply #3 on: 12/03/03, 13:10 »

Thank you Gene,

Flash-DB Staff.
Logged
tony ross
Server what's that
*
Posts: 10



View Profile WWW Email
« Reply #4 on: 12/06/03, 01:04 »

Hello-
i'm new to the forum and even newer to PHP... I am an artist/ animator by trade...
in short code is greek to me.
here is my issue. i was getting the card and the email but no text
i tried this new code after nothing else worked...i got this error:

Parse error: parse error, expecting `T_CASE' or `T_DEFAULT' or `'}'' in /home/ar-tistc/public_html/Ecards/SelectCard.php on line 10

???
please help me... i feel i'm close to the answer but i don't know enough about PHP to see what's wrong
my host is ipowerweb...
iPowerWeb servers are operating on the PHP version 4.3.2


here is the part of the code that has line 10

<HTML>
<HEAD>
<TITLE>Here's your Flash Ecard - from imagepuddles.com </TITLE>
<?
error_reporting (E_ALL ^ E_NOTICE);
$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($ENum) {

   case '1':
   $goto = "Ecard1.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

thanks-tony
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #5 on: 12/06/03, 04:18 »

Hi Tony,
if the "case" line is more than one line, you have to put {} around the block.
Thats what the error is saying.
Logged

happy flashing
Cool
Ronald
tony ross
Server what's that
*
Posts: 10



View Profile WWW Email
« Reply #6 on: 12/06/03, 04:32 »

so i have to put those {} around line 9? or where?
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #7 on: 12/06/03, 05:00 »

around 10 through 14
« Last Edit: 12/06/03, 05:00 by Ronald Wernecke » Logged

happy flashing
Cool
Ronald
tony ross
Server what's that
*
Posts: 10



View Profile WWW Email
« Reply #8 on: 12/06/03, 05:07 »

ok my { starts at line 7 and my } is on line 43 where am I slipping?
here is my entire code


<HTML>
<HEAD>

<TITLE>Here's your Flash Ecard - from imagepuddles.com</TITLE>

<?
switch ($_GET['ENum'](
   case '1':
   $goto = "Ecard2.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;


   case '2':
   $goto = "Ecard2.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '3':
   $goto = "Ecard3.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=3";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '4':
   $goto = "Ecard4.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=4";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;

   case '5':
   $goto = "Ecard5.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=5";
   $Dimensions = "WIDTH=700 HEIGHT=525";
   $DimensionsFooter = "WIDTH=700 HEIGHT=250";
   break;
   }

?>
</head>

<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">

<center>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
<? 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";?> TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
<? print "$DimensionsFooter";?>>
<PARAM NAME=movie VALUE="<? print "$gotoFooter";?>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="<? print "$gotoFooter";?>" quality=high bgcolor=#FFFFFF  <? print "$DimensionsFooter";?> TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</center>
</BODY>
</HTML>
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #9 on: 12/06/03, 05:15 »

This should work:
Code:

switch ($_GET['ENum']){
  case '1':
  $goto = "Ecard2.swf?EcardText=".$EcardText;
  $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
  $Dimensions = "WIDTH=700 HEIGHT=525";
  $DimensionsFooter = "WIDTH=700 HEIGHT=250";
  break;
  case '2':
  $goto = "Ecard2.swf?EcardText=".$EcardText;
  $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
  $Dimensions = "WIDTH=700 HEIGHT=525";
  $DimensionsFooter = "WIDTH=700 HEIGHT=250";
  break;
  case '3':
 $goto = "Ecard3.swf?EcardText=".$EcardText;
  $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=3";
  $Dimensions = "WIDTH=700 HEIGHT=525";
  $DimensionsFooter = "WIDTH=700 HEIGHT=250";
  break;
  case '4':
  $goto = "Ecard4.swf?EcardText=".$EcardText;
  $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=4";
  $Dimensions = "WIDTH=700 HEIGHT=525";
  $DimensionsFooter = "WIDTH=700 HEIGHT=250";
  break;
  case '5':
  $goto = "Ecard5.swf?EcardText=".$EcardText;
  $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=5";
  $Dimensions = "WIDTH=700 HEIGHT=525";
  $DimensionsFooter = "WIDTH=700 HEIGHT=250";
  break;
}

if you open a bracket, you have to close the same kind Wink
Logged

happy flashing
Cool
Ronald
tony ross
Server what's that
*
Posts: 10



View Profile WWW Email
« Reply #10 on: 12/06/03, 05:23 »

Ok still getting this error
Parse error: parse error, expecting `T_CASE' or `T_DEFAULT' or `'}'' in /home/ar-tistc/public_html/Ecards/SelectCard.php on line 8
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #11 on: 12/06/03, 05:37 »

Try leaving out the quotes

Code:

...
case 1: instead of cas '1':
...
Logged

happy flashing
Cool
Ronald
tony ross
Server what's that
*
Posts: 10



View Profile WWW Email
« Reply #12 on: 12/06/03, 05:45 »

ok still have the error

Parse error: parse error, expecting `T_CASE' or `T_DEFAULT' or `'}'' in /home/ar-tistc/public_html/Ecards/SelectCard.php on line 8
Undecided
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #13 on: 12/06/03, 06:01 »

Then maybe something is wrong with the variable you receive:

for testing do this:
Code:

$key=$_GET['ENum'];
echo $key; //just to make sure you reading the variable right

switch($key){

... the case block

}
Logged

happy flashing
Cool
Ronald
tony ross
Server what's that
*
Posts: 10



View Profile WWW Email
« Reply #14 on: 12/06/03, 06:02 »

i don't know if it will help but here is my link....
http://www.ar-tist.com/Ecards/Ecards.swf
i know i haven't changed any of the graphics, but i wanted to get the code right first... hope this is ok
Logged
Pages: [1] 2 3 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything