Welcome, Guest
  • Author Topic: No dbText file or emails  (Read 6138 times)

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    No dbText file or emails
    « on: 07/25/07, 03:41 »
    Hey guys,

    Thanks for all the work on the ecards. I have been trying to follow and create some for a site but I have hit a snag. I have spent the last few hours reading through the posts - I fixed the field checking error i had to do this instead in  my actions layer.

    send.onRlease() = function() {.....}

    It checks for empty fields, but if I put the right info in, it goes through to the the final else statement, yet does not send correctly.

    I have made the folder 777 and this is the error I recieve.

    *****************************

    Warning: fopen(/dbText/1185351867.txt) [function.fopen]: failed to open stream: No such file or directory in /home/josesmex/public_html/ecards/SendEcard.php on line 30

    Warning: fwrite(): supplied argument is not a valid stream resource in /home/josesmex/public_html/ecards/SendEcard.php on line 31

    Warning: fclose(): supplied argument is not a valid stream resource in /home/josesmex/public_html/ecards/SendEcard.php on line 32
    _root.Status=Success your Card Has Been Sent!

    **********************

    THis is the code for sendphp

    ***************************
    <?

    $createEcard = date(U);

    $filename = $createEcard.".txt";

    $toEmail = $_POST["toEmail"];
    $fromEmail = $_POST["fromEmail"];
    $toName = $_POST["toName"];
    $fromName = $_POST["fromName"];
    $greeting = $_POST["greeting"];
    $cardMessage = $_POST["cardMessage"];
    $ecardSelection = $_POST["ecardSelection"];

    $toName = stripslashes($_POST["$toName"]);
    $fromName = stripslashes($_POST["$fromName"]);
    $greeting = stripslashes($_POST["$greeting"]);
    $cardMessage = stripslashes($_POST["$cardMessage"]);


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

    $Created="Ecard Created on $Today";

    $ecardNum = $ecardSelection;

    $ecardText = "toName=$toName&toEmail=$toEmail&fromName=$fromName&fromEmail=$fromEmail&greeting=$greeting&cardMessage=$cardMessage&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 and Jose's Mexican Food";
    $Message = "$toName,\nYou have recieved a Flash Ecard from $fromName and Jose's Mexican Food. \nClick the following link to view your card:\n\n http://www.josesmexicanfood.com/ecards/SelectCard.php?ecardText=$createEcard&eNum=$ecardNum\n\n-----------------------------------\nHere is the message that was sent:\n$toName,\n$greeting\n$cardMessage\n\n-$fromName\n\n\n-----------------------------------";


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

    ?>

    *******************************

    code for selection

    *****************************

    <HTML>
    <HEAD>

    <TITLE>Here's your Flash Ecard - from Jose's Mexican Food</TITLE>

    <?
    $eNum = $_GET["eNum"];
    $ecardText = $_GET["ecardText"];

    switch ($eNum) {

       case '1':
       $goto = "ecard1.swf?ecardText=".$ecardText;
       $Dimensions = "WIDTH=600 HEIGHT=400";
       break;

       case '2':
       $goto = "ecard2.swf?ecardText=".$ecardText;
       $Dimensions = "WIDTH=600 HEIGHT=400";
       break;

       case '3':
       $goto = "ecard3.swf?ecardText=".$ecardText;
       $Dimensions = "WIDTH=600 HEIGHT=400";
       break;
    }

    ?>
    </head>

    <body bgcolor="#009933" topmargin="10" 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>

    </center>
    </BODY>
    </HTML>

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #1 on: 07/25/07, 03:44 »

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: No dbText file or emails
    « Reply #2 on: 07/25/07, 04:08 »
    It is important that you use the same path assignments and the correct writing in both cases - read and write.
    After you created the file, can you see the file in the filesystem?
    If it is a remote host, you should see it with your ftp-client, or read it via browser.
    happy flashing
    8)
    Ronald

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #3 on: 07/25/07, 11:02 »
    Thanks for replying, Ronald. When I check the folder online, the dbText folder is empty and there are no text files. One thing I noticed, is that the error does not show the full path of that is in the scripts. Any ideas?

    - thanks

    Andresss

    • Systems Administrator
    • *****
    • Posts: 738
    • check me out at www.asb-labs.com/blog
      • View Profile
      • asb-labs
      • Email
    Re: No dbText file or emails
    « Reply #4 on: 07/25/07, 16:31 »
    hey hi rlonac and welcome aboard!!! check that your folder has permissions to write '777'

    cheers!!!
    halemos de flash en español!....wondering about crazy flash experiments?

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #5 on: 07/25/07, 17:43 »
    Hey Thanks for the welcome! I trweaked things a bit, and not we have some action!

    A file is written to the dBText folder, but no email unfortunately. This is the text file:

    ToName=&ToEmail=&FromName=&FromEmail=&Greeting=&IntroMessage=&Created=Ecard Created on Wednesday 25th of July 2007 ( 04:07:44 PM )

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #6 on: 07/25/07, 22:07 »
    Ok, So i figured out that the flash movie is not sending correctly. I only get a text file in the dBText folder when I try to visit the php file in firefox.

    And also for kicks, the sent status is not showing up on the the thank you frame after selecting "send".

    The send button does check for errors and will go to the thank you frame, but I guess it is not sending the info and activating the php.

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #7 on: 07/25/07, 22:08 »
    Oh, and the folder has 777

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #8 on: 07/26/07, 00:44 »
    So Close!!!!!!!!!!!!

    I rebuilt my fla using the template and things are working better now. the only catch is that after sending, the browser keeps saying "waiting for www.josesmexicanfood.com...."  ???

    Andresss

    • Systems Administrator
    • *****
    • Posts: 738
    • check me out at www.asb-labs.com/blog
      • View Profile
      • asb-labs
      • Email
    Re: No dbText file or emails
    « Reply #9 on: 07/26/07, 22:22 »
    hey hi again rlonac!!! well it sounds wierd but try not to use frames, this current version of the Flash cards was built some time ago and the best option to "update" was changing frame, now if you change the frame and the server wasn´t fast enough to execute your request there could be the problem, the best workaround i think about is uisng LoadVars in AS2 or URLRequest in AS3

    cheers!!!
    halemos de flash en español!....wondering about crazy flash experiments?

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #10 on: 07/27/07, 00:13 »
    Thanks Andress! I took out the gotoAndStop to the next frame on the send button. I will try to implement the loadvars and let you know.

    - rlonac

    rlonac

    • Server what's that
    • *
    • Posts: 10
      • View Profile
      • Email
    Re: No dbText file or emails
    « Reply #11 on: 07/27/07, 02:34 »
    When using LoadVars, do I need to construct it and define the variables? Something like this?

    var Vars:LoadVars = new LoadVars();
    Vars.ToName = ToName;
    Vars.ToEmail = ToEmail;
    Vars.FromName = FromName;
    Vars.FromEmail = FromEmail;
    Vars.Greeting = Greeting;
    Vars.IntroMessage = IntroMessage;

    ....

    and then on the button call

    _root.Vars.sendAndLoad("SendEcard.php", What do I put as a target?, "Post");

    and possibly to test

    _root.Vars.onData = function(str:String):Void {
        trace(str)
    }

    is that the right direction?