RE: [PHP] file(http://www.php.net) error?
You will also find that file(); may have been disabled - due to the possible security issues.. ie file ( /etc/shadow); or file (/etc/passwd); I believe that may apply to fopen, too. James -Original Message- From: atan [mailto:[EMAIL PROTECTED]] Sent: 23 June 2001 02:46 To: [EMAIL PROTECTED] Subject: [PHP] file(http://www.php.net;) error? file(http://www.163.com;) error? this is a test: ?php $fcontents = file ('http://www.php.net'); while (list ($line_num, $line) = each ($fcontents)) { echo bLine $line_num:/b . htmlspecialchars ($line) . br\n; } ? / This program run no error in my server ; but it not work when i sent it to the Server (mtkj.51.net) The message: Warning: file(http://www.163.com;) - Permission denied in /z1/mtkj/public_html/test.php on line 2 Warning: Variable passed to each() is not an array or object in /z1/mtkj/public_html/test.php on line 3 why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file(http://www.php.net) error?
atan [EMAIL PROTECTED] wrote in message 9h0s59$l4h$[EMAIL PROTECTED]">news:9h0s59$l4h$[EMAIL PROTECTED]... file(http://www.163.com;) error? this is a test: ?php $fcontents = file ('http://www.php.net'); while (list ($line_num, $line) = each ($fcontents)) { echo bLine $line_num:/b . htmlspecialchars ($line) . br\n; } ? / This program run no error in my server ; but it not work when i sent it to the Server (mtkj.51.net) The message: Warning: file(http://www.163.com;) - Permission denied in /z1/mtkj/public_html/test.php on line 2 Warning: Variable passed to each() is not an array or object in /z1/mtkj/public_html/test.php on line 3 why? I'm betting on your ISP having a version of PHP so old that the URL-wrapper isn't in the file() function, so it can only open local files, not URLs. You *may* be able to fopen(http://www.php.net;, r) and read it that way -- The file() function lagged behind fopen() in terms of when URL support got added, I believe. Use ?php phpinfo();? to check the PHP version on your ISP box, and nag your ISP to upgrade to something from this doggie-decade. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file(http://www.php.net) error?
Dunno,... Maybe you should specify the full file path, ie: file(http://www.163.com/index.htm) ? atan [EMAIL PROTECTED] wrote in message 9h0s59$l4h$[EMAIL PROTECTED]">news:9h0s59$l4h$[EMAIL PROTECTED]... file(http://www.163.com;) error? this is a test: ?php $fcontents = file ('http://www.php.net'); while (list ($line_num, $line) = each ($fcontents)) { echo bLine $line_num:/b . htmlspecialchars ($line) . br\n; } ? / This program run no error in my server ; but it not work when i sent it to the Server (mtkj.51.net) The message: Warning: file(http://www.163.com;) - Permission denied in /z1/mtkj/public_html/test.php on line 2 Warning: Variable passed to each() is not an array or object in /z1/mtkj/public_html/test.php on line 3 why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]