1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Rep Power
    Apologies if this has been answered before...

    I am trying to read the contents of a text file using php. . I know the location of the file as an encoded form post to a perl script. My dumb vendor will not reveal the path to my own log files for the script we have purchased from them! Anyway, I tried the following unsuccessfully:


    $file = "http://congress.nw.dc.us/cgi-bin/usagelogs.pl?download=1&dir=lchr&logfile=senders030100.txt&textfile=%20Text%20File%28s%29%20";

    $file_content = fread(fopen($file, "r"), filesize($file));
    echo "$file_content";


    the url above will trigger the download messagebox in IE when entered into the browser... Any ideas on how to fix this?

    Many thanks!
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Rep Power

    I think once you run "usagelogs.pl".this program will return a log-file in downloadable mode.

    You should contact your vendor for clarifying this...

    SR -

    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. Store part of URL in session variable?
    By Jonny5uk in forum ASP Programming
    Replies: 4
    Last Post: February 13th, 2004, 07:34 AM
  2. Possible to read in value from a text file?
    By discus18 in forum PHP Development
    Replies: 2
    Last Post: February 6th, 2004, 11:19 PM
  3. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 07:42 PM
  4. read a file bit-by-bit
    By L7Sqr in forum C Programming
    Replies: 11
    Last Post: January 31st, 2004, 05:37 PM
  5. How to read multiple line text file into a variable
    By gatewaycityca in forum Visual Basic Programming
    Replies: 4
    Last Post: January 29th, 2004, 12:26 PM

IMN logo majestic logo threadwatch logo seochat tools logo