• 0

Old Website (need php and flash help)


Question

A long while back I was trying to make some flash website. I lost interest because I wasn't feeling creative, but now I'd like to try again. I have a whole line up of content ready to go, but now the site refuses to work. A small orange updated the php from 4.x to 5.3.17

This is the tutorial I used (My code is more updated than shown in the link)

http://www.angelfire...dsTutorial.html

My problem is that the e-card is not showing the text that is supposed to come from a text file in a directory called dBText. (hugclub.net/dBText) (exposed for now so you can view it) The directory does generate the text with no problems (created by the php file) and the greeting appears correctly in the received email, but the actual flash e-card does not show the text.

4 files handle this, SendEcard.php, SelectEcard.php, a button in the main movie and the e-card swf itself.

Main Movie's send button after filling out the form.


on (release) {
if (ToName eq "") {
Status = "Please enter the Name of the person your sending this to";
} else if (FromName eq "") {
Status = "Please enter your Name";
} else if (ToEmail eq "") {
Status = "Please enter the Email address your sending this to";
} else if (FromEmail eq "") {
Status = "Please enter your email address";
} else if (Greeting eq "") {
Status = "Please enter a greeting message";
} else if (IntroMessage eq "") {
Status = "Please enter a Intro Message";
} else {
gotoAndStop (3);
Status = "Sending Ecard - Please Hold";
loadVariablesNum ("SendEcard.php", 0, "POST");
}
}
[/CODE]

SendEcard.php

[CODE]
<?
$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["selected"];
$Today = (date ("l dS of F Y ( h:i:s A )",time()));
$Created = "Ecard Created on $Today";
$EcardNum = $_POST['EcardSelect'];
$EcardText = "ToName={$_POST['ToName']}&ToEmail={$_POST['ToEmail']}&FromName={$_POST['FromName']}&FromEmail={$_POST['FromEmail']}&Greeting={$_POST['Greeting']}&IntroMessage={$_POST['IntroMessage']}&Created={$_POST['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 = "E-card from $FromName";
$Message = "$ToName,\nYou have recieved a Flash E-card from $FromName. \nClick the following link to view your card:\n\n http://www.hugclub.net/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 by Bunny and Panda\n\nMaking you smile a little more each time.";
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FromName." <".$FromEmail.">");
## This next line returns a success message to the movie.
print "_root.holder.Status=\n Copy the following link to view your card:\n http://www.hugclub.net/SelectCard.php?EcardText=$CreateEcard%26ENum=$EcardNum\n";
?>
[/CODE]

SelectEcard.php

[CODE]
<?
switch ($_GET['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;
case '20':
$goto = "Ecard20.swf?EcardText=".$EcardText;
$gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=20";
$Dimensions = "WIDTH=700 HEIGHT=525";
$DimensionsFooter = "WIDTH=700 HEIGHT=250";
break;
}
?>
[/CODE]

e-card action script: There are dynamic text fields with variables that match those in SendEcard.php such as FromName etc...

[CODE]
loadVariablesNum ("http://hugclub.net/dBText/"+EcardText+".txt", 0);
[/CODE]

This is what's generated in the text file: [email=ToName=You&ToEmail=zodiac_izlude@hotmail.com&FromName=Me&FromEmail=ecards@hugclub.net&Greeting=Test&IntroMessage=Hello]ToName=You&ToEmail=zodiac_izlude@hotmail.com&FromName=Me&FromEmail=ecards@hugclub.net&Greeting=Test&IntroMessage=Hello[/email] to me bla bla bla...&Created=&

This is the e-card which isn't showing the text:

http://www.hugclub.n...9764705&ENum=20

This is the e-mail I get after it sends:

http://img844.imageshack.us/img844/313/emailsample.jpg

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Additional info, this came from the error log for the website:

File does not exist: /home/izlude/public_html/dBText/.txt, referer: http://www.hugclub.net/Ecard20.swf?EcardText=

It shows up in the log each time I try to view the e-card. It's like it is trying to reach the generated text file in the dBText directory. The texts do appear in there, but it almost looks like it's searching for a text with no name (the error shows .txt, not 12345678.txt) Wonder what this means.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.