Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 12:46
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
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  guest book
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: guest book  (Read 5702 times)
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« on: 06/16/02, 21:17 »

I still have a problem with my guest book. Nothing happen when I hit the submit button and I don't understand why?


And I have the script from the tutorial written on the submit button: (I am using MX by the way)

on (release) {
    if (Name eq "") {
        _root.Status = "Please enter your name";
    } else if (Email eq "") {
        _root.Status = "Please enter email Address";
    } else if (Website eq "") {
        _root.Status = "Please enter the URL to your website";
    } else {
        Submit = "Yes";
        NumHigh = 10;
        NumLow = 0;
        _root.GuestBook = "Processing..   Loading New... ";
        loadVariablesNum("GuestBook.php", 0, "POST");
        _root.Status = "Your entry has been submitted.  You should see your
comments appear immediatly";
        gotoAndStop(2);
    }
}

What could be wrong ?

« Last Edit: 06/19/02, 14:49 by 3dsound » Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #1 on: 06/16/02, 22:12 »

It is not an actionscript problem....at least it really doesn't appear so.  The variables are being sent...your php is all good and executing fine, but you need to CHMOD (change the permissions) of your textfile to 666.  Their is a little article on CHMOD here (by Musicman).....

http://www.flash-db.com/Board/index.php?board=19;action=display;threadid=977


If changing the file permissions doesn't help then post it.  But that should do the trick.  Oh...and I like the site.  Where did you get the logo from?  You make it?  If so, what program? Lates.
« Last Edit: 06/16/02, 22:13 by BurtonRider1983 » Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #2 on: 06/17/02, 11:46 »

Oh I see. I had the CHMOD changed to 777...

Thanks for you comment on my site! Actually the real address for it is:

http://www.pearljamorb.tscwd.com

The logo, you mean the rotating sphere? I made it myself in 3D max.

Thank you for your help! Smiley
« Last Edit: 06/17/02, 12:00 by 3dsound » Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #3 on: 06/17/02, 14:22 »

777 should also work for the CHMOD of the textfile. hmmm.  Tell me if changing it worked, but 666 and 777 should both work fine.  666 is just better for security reasons.  That is odd.  Well if it didn't work with the permissions set at 777 then this probably won't fix your problem.  You php script is running fine and has no errors in it.  Did you use the source files from Flash-DB or did you do the tutorial?  If you downloaded the php from the site then we could be almost positive that there is no problem in the script.  Well....since this is taking up alot of your time...if it still doesn't work, then send me the fla.  IanShark16@aol.com.  I will get to it ASAP.

I tried to get 3D max running on my computer, but no luck.  I like the sphere.  Well gtg, Lates.
                                                                             -Ian
Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #4 on: 06/17/02, 17:31 »

I emailed you

Thanks!
Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #5 on: 06/17/02, 22:38 »

Well, I put in the absolute references to the guestbook.php file on my server and it all worked fine....with a couple bugs....
-set the main textbox for viewing html
-the scrollbar

If you have permissions set correctly on your textfile then it is the php script causing the problems.  copy this code over exactly.

<?php
$Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
   $Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email);
   $Comments = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Comments);

   $Website = eregi_replace("http://", "", $Website);
   $Website = ereg_replace("[^A-Za-z0-9 \@\.\-\/\'\~\:]", "", $Website);

   $Name = stripslashes($Name);
   $Email = stripslashes($Email);
   $Website = stripslashes($Website);
   $Comments = stripslashes($Comments);


if ($Submit == "Yes") {
   $filename = "GuestBook.txt";
   $fp = fopen( $filename,"r");
   $OldData = fread($fp, 80000);
   fclose( $fp );


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



   $Input = "Name: <b>$Name</b><br>Email: <b><u><a href=\"mailto:$Email\">$Email</a></b></u><br>Website: <b><u><a href=\"http://$Website\" target=\"_blank\">$Website</a></b></u><br>Comments: <b>$Comments</b><br><i><font size=\"-1\">Date: $Today</font><br><br>.:::.";


   $New = "$Input$OldData";



   $fp = fopen( $filename,"w+");
   fwrite($fp, $New, 80000);
   fclose( $fp );
}



   $filename = "GuestBook.txt";



   $fp = fopen( $filename,"r");
   $Data = fread($fp, 80000);
   fclose( $fp );


   $DataArray = split (".:::.", $Data);


   $NumEntries = count($DataArray) - 1;

   print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
   for ($n = $NumLow; $n < $NumHigh; $n++) {
   print $DataArray[$n];
      if (!$DataArray[$n]) {
      Print "<br><br><b>No More entries</b>";
      exit;
      }
   }
?>
Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #6 on: 06/18/02, 02:05 »

Gosh...

I want to thank you for your help..

You're dealing with a moron in PHP scripting. As much as I am allright in graphic design, layout and basic scripting... I am a moron in anything relayed to message board and guest book level of scripting.

I give up... Sad    stupid submit button, stupid PHP that doesn't work, stupid me that doesn't even know how I am suppose to overwrite the PHP script...

Sad Sad
Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #7 on: 06/18/02, 12:57 »

Wow.....no, no, no.  Don't give up.  I am not great at PHP scripting either.  Don't worry about it.  Ok, it is really easy.  Just open the php file in your basic text editor.  That is all, just like with html.  You can open it by renaming the file extension as txt.  Now you just delete everything in it....copy what I typed and paste it in.  Save it, you will have to make suer that it saves as GuestBook.php and not txt...you can save as "all file types" to do this or you could just simply save and rename it.  

When I first got into Flash, this was actually the first thing that I did.  I was discouraged at times and I won't even tell you how many hours I spent trying to get a guestbook up.  We will get it to work.  Did you do the tutorial or copy the source files and change them to your liking?
« Last Edit: 06/18/02, 18:31 by BurtonRider1983 » Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #8 on: 06/18/02, 17:37 »

LOL

Thanks for the encouragement and convincing me not to give up. I'll try that later on..

Thanks!
Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #9 on: 06/19/02, 14:59 »

submit button still not working! Embarrassed
Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #10 on: 06/19/02, 19:39 »

Could you post the link to your swf, php, and txt files?.....I will give then a look.  Sorry this is taking so long to get worked out for you.
Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #11 on: 06/20/02, 14:11 »

http://gbtest.tscwd.com
Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #12 on: 06/20/02, 17:55 »

There...it works.   Grin
bout time, huh? Lates.

Post your site in the showcase if you want.
Logged
3dsound
Server what's that
*
Posts: 15



View Profile WWW Email
« Reply #13 on: 06/20/02, 18:13 »

what do you mean it works!?  Wink

what am I suppose to change then to make it works on my side then?
Logged
BurtonRider1983
Global Moderator
Systems Administrator
*****
Posts: 864

Rider-4-Life

BurtonRider1983
View Profile WWW
« Reply #14 on: 06/20/02, 18:15 »

I mean it works now...it is fixed.  Go to the address (your server)....see for yourself.
« Last Edit: 06/20/02, 18:15 by BurtonRider1983 » Logged
Pages: [1] 2 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!