Welcome, Guest
  • Author Topic: problem with tutorial  (Read 1929 times)

    igor

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    problem with tutorial
    « on: 02/14/02, 19:40 »
     ???
    hi everybody!
    i have problem at first script in tutorial

    NumLow = 0;
    NumHigh = 100;
    loadVariablesNum ("\"GuestBook.php?NumLow=\"+NumLow+\"&NumHigh=\"+NumHigh+\"&R=\"+random(999)", 0);
    stop ();

    i have error!!!
    i don`t know what i`m doing, and then i don`t know where i can write script
    <?
    1)      $Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
    2)      $Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email);
    3)      $Comments = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Comments);

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

    6)      $Name = stripslashes($Name);
    7)      $Email = stripslashes($Email);
    8)      $Website = stripslashes($Website);
    9)      $Comments = stripslashes($Comments);

    10)      if ($Submit == "Yes") {
    11)         $filename = "GuestBook.txt";
    12)         $fp = fopen( $filename,"r");
    13)         $OldData = fread($fp, 80000);
    14)         fclose( $fp );
    15)         $Today = (date ("l dS of F Y ( h:i:s A )",time()));
       
    16)         $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>.:::.";

    17)         $New = "$Input$OldData";
       
    18)         $fp = fopen( $filename,"w");
    19)         fwrite($fp, $New, 80000);
    20)         fclose( $fp );
    21)      }
    22)      $filename = "GuestBook.txt";
    23)      $fp = fopen( $filename,"r");
    24)      $Data = fread($fp, 80000);
    25)      fclose( $fp );
       
    26)      $DataArray = split (".:::.", $Data);
    27)      $NumEntries = count($DataArray) - 1;
    28)      print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&Guest Book=";
    29)      for ($n = $NumLow; $n < $NumHigh; $n++) {
    30)      print $DataArray[$n];
    31)         if (!$DataArray[$n]) {
    32)         Print "<br><br><b>No More entries</b>";
    33)         exit;
    34)         }
    35)      }
       ?>

    ??????????????????????????????????????????????????????
    i really don`t know!!
    PLZ HELP!!!
    THANX!!!

    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:problem with tutorial
    « Reply #1 on: 02/17/02, 14:19 »
    First of all the loadVariables command in the Flash Movie should look like this:

    NumLow = 0;
    NumHigh = 10;
    loadVariablesNum ("GuestBook.php?NumLow="+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);
    stop();

    You should not put the back slashes in here as you don't want to comment out any of these quotes.  

    Second,

    Use the Script from the Download File - and not the one from the Tutorial Text.  The Numbers are from the tutorial and are only included to explain each line.  The real script does not use these Numbers and will cause all kinds of problems if your try to use that one.

    Download the complete files here:
    http://www.flash-db.com/GuestBookTut/GuestBookTutorial.zip

    Then use GuestBook.php - as the script and not the one your showed on the post.  
    Flash-DB