php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10637 Reading a file into array using file() from Windows IE and Opera
Submitted: 2001-05-03 12:09 UTC Modified: 2001-05-03 12:28 UTC
From: a dot j dot dudas at dur dot ac dot uk Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: Mandrake Linux 8.0
Private report: No CVE-ID: None
 [2001-05-03 12:09 UTC] a dot j dot dudas at dur dot ac dot uk
Using this to submit:

echo "<form action=\"import.php\" method=\"post\" enctype=\"multipart/form-data\" >\n";
echo "<input type=\"file\" name=\"filename\"><br>Click browse to select a file to import\n";
echo "<br>";
echo "\n<br><br><input type=\"submit\" value=\"Import Database\">\n</form>\n";

and this to read the text file into an array:

$fcontents = $file($filename);

works perfectly when from the Linux box and using Netscape 4.6 in Windows, but does not work from IE 5.5 or Opera 5.10 in Windows.

They both give an HTML output of:

Warning:  file("Content-Type: text/plain; name=\"savedrecs.txt\" ...text cut out... JI Bioche in /home/httpd/html/paper_database/includes/classes.inc on line 312

and this when trying to read it into an array, as it has not read it into the array:

Warning:  Variable passed to each() is not an array or object in /home/httpd/html/paper_database/import.php on line 41

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-03 12:28 UTC] sniper@php.net
Please upgrade to PHP 4.0.5 as this should be fixed in it.
Reopen this bug report if this is not the case.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 11:01:32 2024 UTC