Welcome, Guest
  • Author Topic: Use this code if your Server is running php 4.1.0 or newer  (Read 30541 times)

    Arclave

    • Server what's that
    • *
    • Posts: 22
    • Americanism is Live and Kicking at www.rwyouth.com
      • View Profile
      • Robert Welch Youth
    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

    ?>

    Arclave

    • Server what's that
    • *
    • Posts: 22
    • Americanism is Live and Kicking at www.rwyouth.com
      • View Profile
      • Robert Welch Youth
    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>

    Arclave

    • Server what's that
    • *
    • Posts: 22
    • Americanism is Live and Kicking at www.rwyouth.com
      • View Profile
      • Robert Welch Youth
    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 »

    vesa kortelainen

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 3450
      • View Profile
    Thank you Gene,

    Flash-DB Staff.

    tony ross

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • anthony ross official site
      • Email
    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

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Hi Tony,
    if the "case" line is more than one line, you have to put {} around the block.
    Thats what the error is saying.
    happy flashing
    8)
    Ronald

    tony ross

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • anthony ross official site
      • Email
    so i have to put those {} around line 9? or where?

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    around 10 through 14
    « Last Edit: 12/06/03, 05:00 by Ronald Wernecke »
    happy flashing
    8)
    Ronald

    tony ross

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • anthony ross official site
      • Email
    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>

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    This should work:
    Code: [Select]

    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 ;)
    happy flashing
    8)
    Ronald

    tony ross

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • anthony ross official site
      • Email
    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

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Try leaving out the quotes

    Code: [Select]

    ...
    case 1: instead of cas '1':
    ...
    happy flashing
    8)
    Ronald

    tony ross

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • anthony ross official site
      • Email
    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
    :-\

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Then maybe something is wrong with the variable you receive:

    for testing do this:
    Code: [Select]

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

    switch($key){

    ... the case block

    }
    happy flashing
    8)
    Ronald

    tony ross

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • anthony ross official site
      • Email
    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