|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-02-07 14:01 UTC] mqm at magma dot ca
I am trying to fetch the web page from my Linksys ADSL router, which is password-protected, but fopen does not seem to understand the URL format where a user/password is provided (like with FTP). See below. <?php $linksys_info_url = "http://user:password@192.168.3.1/Status.htm"; $f_page = @fopen ($linksys_info_url, "r"); if ($f_page) { $page_contents = fread ($f_page, 1024); fclose ($f_page); print ($page_contents); } else { echo "Can't fetch the page ($linksys_info_url), so I am giving up !!"; } ?> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
curl (like wget) can fetch the page, so I don't think there are any redirects. This is what I get if I remove the @ before fopen: <font color=ff0000><br> <b>Warning</b>: fopen("http://...@192.168.3.1/Status.htm", "r") - No error in <b>C:\Xitami\webpages\test.php</b> on line <b>5</b><br> </font>Can't fetch the page (http://user:password@192.168.3.1/Status.htm), so I am giving up !!Unclear what the resolution was for this, is there a way to get php to say HTTP/1.1 instead of HTTP/1.0? I am having a similar problem, but I am getting: <br> <b>Warning</b>: fopen("http://...@192.168.1.1/", "r") - Inappropriate ioctl for device in <b>/home/exoplanet/devel/php_test/urlcp.php</b> on line <b>17</b><br> Line 17 is the fopen.....