fputs VS fwrite help
Results 1 to 3 of 3

Thread: fputs VS fwrite help

  1. #1
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    fputs VS fwrite help

    Hi,
    I am trying to write some variables to a file and here is the delema:

    echo $d;
    $what="$a|$b|$c|$d"."\n";


    $file2=fopen("pathtofile.txt","w");
    $fp=fwrite($file2,$what,4096);
    fclose($file2);

    The above DOESN'T work....but this does:

    $what="$a|$b|$c"."\n";


    $file2=fopen("pathtofile.txt","w");
    $fp=fwrite($file2,$what,4096);
    fclose($file2);

    I know $d exists...because I can echo it out before I'm adding it to the string, as seen above. Any idea why this last variable doesn't get included in the string? I can replace the $d="varible from the web" with
    $d="hard coded text" and it works just fine.

    I'm on an Apache server.

    Any ideas??

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: fputs VS fwrite help

    P.S. I've also tried fputs with the same results.

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: fputs VS fwrite help

    The script that is trying to write to the file is a child window created by javascript with newwin().
    Could this be the problem? The child window can't write to a file??

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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