Writing to Html file problem?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marslee@hotmail.com

    #1

    Writing to Html file problem?

    I had problem of writing the php data to the html, everytime i submit
    the info, the data is added to the database, but not to the html file

    $ourFileName = "testFile.html" ;
    $ourFileHandle = fopen($ourFileN ame, 'w') or die("can't open file");

    $last = trim($_POST['last']);
    $comment = trim($_POST['comment']);

    fwrite($ourFile Handle, "$last"\n$comme nt");

    fclose($ourFile Handle);

  • Stefan Heinrichsen

    #2
    Re: Writing to Html file problem?

    Am Mo 09.05.05 um 15:07 CEST schrieb marslee@hotmail .com:
    [color=blue]
    > I had problem of writing the php data to the html, everytime i submit
    > the info, the data is added to the database, but not to the html file
    >
    > fwrite($ourFile Handle, "$last"\n$comme nt");[/color]

    Hint: do a error_reporting (E_ALL); in you scripts. Than you propably had
    seen the problem of the wrong quotes:
    fwrite($ourFile Handle, "$last"\n$comme nt");
    should be
    fwrite($ourFile Handle, "$last\n$commen t");

    stefan

    Comment

    Working...