both my PHP book and php.net don't have the answer in the manual so i come to you guys.

how can i open a file then have it DISPLAY that file's contents?

i tried this
fopen ("index_tfc.inc","r+");

but that doesn't do anything, when i look at the page source it says the source is just <html><body></body></html> meaning it printed absolutely nothing.
i also tried to have it do that as a function like $buh = fopen("index_tfc.inc","r+") and i also tried having it echo the thing above

here is the manual, doesn't really say much to help me
http://www.php.net/manual/en/function.fopen.php

any help would be appreciated

btw it's on Windows so there shouldn't be any problems with CHMOD 😉

safe_mode and open_basedir are both disabled

    Hi,

    try following:

    $fd = fopen ("./index_tfc.inc", "r");
    while (!feof ($fd)) {
        $buffer = fgets($fd, 4096);
        echo $buffer;
    }
    fclose ($fd);

    It uses the function [FONT=courier new]fgets()[/FONT].

    wizkid

      Write a Reply...