Page 4 of 4 FirstFirst ... 234
Results 31 to 34 of 34

Thread: Guestbook posting problem

  1. #31
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    This is a sloppy work around but... put the text file in another directory by itself then link the directory addressed in this with that directory then load this page once and it should set it.

    PHP Code:
    <?php
    $dir 
    '/change me change me change me/';
    $d dir($dir);
    while(
    FALSE !== ($entry $d->read()))
    {
       if(
    $entry != '.' && $entry != '..')
       {
          
    // get the file permissions
          
    $perms substr(sprintf('%o'fileperms($dir.$entry)), -4);
          if(
    $perms !== '0777')
          {
             if(
    chmod($dir.$entry0777)===TRUE)
             {
             
    //WORKED DID CHANGE
            
    echo "Your textfile should be writeable now YAY!";
             }
             else
             {
             
    //ERROR DIDN'T CHANGE
          
    echo "Chris messed up.";

             }
          }      
       }
    }
    ?>

  2. #32
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Make sure the directory you have guestbook.php also 777.
    Jeremy | jfein.net

  3. #33
    Join Date
    Jul 2008
    Location
    boston, ma
    Posts
    88
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Ok So I made file permission.php with the code you gave me. I link the dir with txt/guestbook.txt
    When I go to the permission.php file I get these errors


    Warning: dir(txt/guestbook.txt) [function.dir]: failed to open dir: No error in D:\Hosting\3030954\html\HeadFirstGraphics\ourwedding\Chrisguestbook\permission.php on line 6

    Fatal error: Call to a member function read() on a non-object in D:\Hosting\3030954\html\HeadFirstGraphics\ourwedding\Chrisguestbook\permission.php on line 7

    The directory has all permissions.


    also i put this code that you gave me at the beginning in guests.php
    PHP Code:
         <div style="width:650px; height:425px; overflow:auto; border:1px solid #000000;">
    <?php 
    $myFile 
    "txt/guestbook.txt";
    $fh fopen($myFile'r');
    $theData fread($fh20000000);
    fclose($fh);
    $notesout str_replace("\r""<br/>"$theData); echo $notesout;
    ?>
    </div>
    But it no file references guests.php...I assume some file is made to open this code...could this be a problem?

    Thanks
    Will

  4. #34
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    wanna send me your ftp info on facebook and I'll see if I can get it working i'm kinda confused with everything you just sent. or aim/ichat me I'm at zzzzwannnnn

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •