Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 07:53
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 28498 times)
tony ross
Server what's that
*
Posts: 10



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


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



sorry, but where do i put this?
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


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

Did you do all the changes I told you to do?
Check all the brackets etc.
Logged

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



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


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

}



ok is this a different php page i create? i added it to the orig page and still got errors.
thank you for your patience, i just got into this type of coding on thursday
Logged
tony ross
Server what's that
*
Posts: 10



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

YEAHHHH!!!!! ;D
finally got my code straight, my ecards work!! thanks again for your patience and help... now I know what my students must feel like :-\... thanks again-tony ross

p.s. I ended up using a permission of 733 on my dBText to get it to work... is that normal?
Logged
Arclave
Server what's that
*
Posts: 22


Americanism is Live and Kicking at www.rwyouth.com


View Profile WWW
« Reply #19 on: 12/08/03, 09:18 »

I feel for you, I'm a graphic designer by trade as well.... I'm finding that I have to learn code here and there as I go. Sorry about the screw up. I got a simular error. I couldn't find the problem. But this code is what I'm currently using. http://www.rwyouth.com/Ecards/index.php.

 I thing that the problem is caused by having a line break between the switch variables and the get variables. But I'm no php expert. Here's the code that I'm using:


<?
$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($ENum) {

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

   case '2':
   $goto = "Ecard2.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
   $Dimensions = "WIDTH=400 HEIGHT=700";
   $DimensionsFooter = "WIDTH=400 HEIGHT=550";
   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;
}

?>
« Last Edit: 12/08/03, 09:24 by Gene Ritter » Logged
Alberto
Server what's that
*
Posts: 3



View Profile Email
« Reply #20 on: 01/25/04, 23:08 »

I have the same problem with the parser error: Parse error: parse error, expecting `T_CASE' or `T_DEFAULT' or `'}'' in /home/caraco/paginas/Ecards/SelectCard.php on line 8

I did everything what here it is recommended but the problem is not
solved, could help me please?
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #21 on: 01/26/04, 08:50 »

Hi Alberto,
could you show us line 7 through 9?
Logged

happy flashing
Cool
Ronald
Arclave
Server what's that
*
Posts: 22


Americanism is Live and Kicking at www.rwyouth.com


View Profile WWW
« Reply #22 on: 01/26/04, 08:58 »

Yeah show us the code....


Gene
Logged
Alberto
Server what's that
*
Posts: 3



View Profile Email
« Reply #23 on: 01/26/04, 09:14 »

Sure! this it is the code that at the moment I am using.

SelectCard.php:
--------------------------
<HTML>
<HEAD>
<TITLE>Here's your Flash Ecard - from the Flash-dB.com Tutorial</TITLE>
<?
$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($_GET['ENum']){
  case '1':
   $goto = "Ecard1.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
   $Dimensions = "WIDTH=400 HEIGHT=700";
   $DimensionsFooter = "WIDTH=400 HEIGHT=550";
   break;
   case '2':
   $goto = "Ecard2.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
   $Dimensions = "WIDTH=400 HEIGHT=700";
   $DimensionsFooter = "WIDTH=400 HEIGHT=550";
   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>
-----------------------------

SendEcard.php:
-----------------------------
<?
$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.caracolonline.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 #24 on: 01/26/04, 09:53 »

These lines of code is where the problem is:

$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($_GET['ENum']){

You can't switch ($_GET['ENum']Wink if that variable has already been dumped into the variable $ENum.

Try it like this:


<?
$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($ENum) {



If that still doesn't work try replacing the double quotes in the first line listed above to single quotes like so...

$ENum = $_GET['ENum'];



Gene
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #25 on: 01/26/04, 09:56 »

Hi,

The only thing I can see is this:
Code:

$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($_GET['ENum'])


1. why you ask the $_GET twice?
2. why you use different quotes?

If you allread asked $Enum, you dint need to ask $GET['enum'] again.

And: be consequent by using quotes. The interpreter might get mixed up. But you will definately get mixed up after a while Wink

I would change it to this:
Code:

$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($ENum)

Logged

happy flashing
Cool
Ronald
Alberto
Server what's that
*
Posts: 3



View Profile Email
« Reply #26 on: 01/26/04, 10:23 »

Mhhhh... the problem is not fixed   Embarrassed
See here:
http://www.caracolonline.com/Ecards/
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #27 on: 01/26/04, 10:57 »

Hi,
use either
case 1:

or

case "1":
Logged

happy flashing
Cool
Ronald
Arclave
Server what's that
*
Posts: 22


Americanism is Live and Kicking at www.rwyouth.com


View Profile WWW
« Reply #28 on: 01/26/04, 11:05 »

It's a stab in the dark... But try saving your index page as a .php as opposed to .html....
Logged
christy
Server what's that
*
Posts: 3



View Profile Email
« Reply #29 on: 08/13/04, 18:07 »

Hello! I'm having the same error with line 8. Smiley Here is the code I'm using:


<?
$ENum = $_GET["ENum"];
$EcardText = $_GET["EcardText"];
switch ($ENum)
   case '1':
   $goto = "Ecard1.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
   $Dimensions = "WIDTH=400 HEIGHT=700";
   $DimensionsFooter = "WIDTH=400 HEIGHT=550";
   break;
   case '2':
   $goto = "Ecard2.swf?EcardText=".$EcardText;
   $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
   $Dimensions = "WIDTH=400 HEIGHT=700";
   $DimensionsFooter = "WIDTH=400 HEIGHT=550";
   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;
}
?>


I tried every variation here. I starting messing around with graphics and then realized the text wasn't showing up, so I replaced the PHP with the script in this thread, and now I'm getting the same error in line 8. I'm also using Flash MX, but I'm saving it as Flash 5. Maybe that's why it's not working? I looked at another thread that gave advice about using this tutorial with MX, but I'm afraid it didn't tell me much. I'm not really familiar with coding or actionscript, so finding my own solution is not working out too well and I'm slowly going mad. Cheesy If someone could help me in the next few days, that would be really wonderful.

Christy




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