|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-10-31 17:16 UTC] omikorn at yahoo dot com
[2006-11-08 14:23 UTC] tony2001@php.net
[2006-11-16 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 04:00:01 2025 UTC |
Description: ------------ Ok there is a problem with URL wrappers when the remote server requires authentification. Reproduce code: --------------- Take file_get_contents for example: //example code $user="user"; $pass="somepassword"; $url = "www.whatever.com/members/messages.xml" $content = file_get_contents("http://$user:$pass@$url"); $echo "Your new message is\n"; On the packet capture the things show like this: T 65.111.170.157:33470 -> 196.34.149.111:80 [AP] GET /members/messages.xml HTTP/1.0\r\n HTTP/1.0\r\n ## T 65.111.170.157:33470 -> 196.34.149.111:80 [AP] Authorization: Basic bWI1MTptYXJpbHluMw==\r\nHost: www.property24online.co.za\r\n\r\n Of course this failes. Wouldn't it be correct to pass the auth credentials _before_ the HTTP method is specified and more assign a temporary cookie? e.g: GET /members/messages.xml HTTP/1.0\r\n Authorization: Basic bWI1MTptYXJpbHluMw==\r\nHost: www.property24online.co.za\r\n HTTP/1.0\r\n\r\n