Jump to content

mscava

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by mscava

  1. first of all... i am newbie...

    well i'm trying to code a simple guestbook. i have ubuntu 6.06. the problem is that i just can't write into a file. i guess it has something to do with permissions. but my file book.txt has em -rw -rw -rw.

    here is my code:

    [code]<?php
    $path = "book.txt";
    if ($action=='save'):
    @$file = fopen($path, "r");
    @$content = fread($file, filesize($path));
    @FClose($file);
    if (($message=="") or ($nick=="")):
    echo "<p>Nie su vyplnene pozadovane udaje!</p>";
    else:
    $file = fopen($path, "w");
    $str = "<div><h4>".$nick.", ".Date("d-m-Y, H:i:s")."</h4><p>".$message."</p></div>";
    fputs($file, "$str");
    fputs ($file, "$content");
    FClose($file);

    @$file = fopen($path, "r");
    @fpassThru($file);
    endif;
    else:
    @$file = fopen($path, "r");
    @fpassThru($file);
    endif;
    ?>[/code]

    anyone has any ideas what to do... or is it the code's fault?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.