Re: [PHP] accessing protected remote files
Check examples and user notes in the manual: http://www.php.net/manual/en/function.fsockopen.php David Feldman wrote: How would that work? --Dave On Monday, March 31, 2003, at 09:27 AM, Marek Kilimajer wrote: You need to use socket functions and check the response headers David Feldman wrote: I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing protected remote files
How would that work? --Dave On Monday, March 31, 2003, at 09:27 AM, Marek Kilimajer wrote: You need to use socket functions and check the response headers David Feldman wrote: I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing protected remote files
That's what I thought too, but it's not happening...fopen() is simply returning an error. --Dave On Monday, March 31, 2003, at 09:35 AM, [EMAIL PROTECTED] wrote: Assuming you are retrieving this file via http/https then it's really the remote server that will enforce the access control in whatever manner is uses. I.e., if your script tries to open a file whose access is controlled by a .htaccess file (and http-basic authentication) the user will simply get the authentication prompt when they access your page/php script. -- Original Message -- From: David Feldman <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Monday, March 31, 2003 09:13:00 AM -0500 Subject: [PHP] accessing protected remote files I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- End Original Message -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing protected remote files
You need to use socket functions and check the response headers David Feldman wrote: I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accessing protected remote files
I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php