Sending htaccess auth information through php
| From: | Daevid Vincent | Date: | Fri, 17 Oct 2003 02:18:04 +0000 |
| Subject: | Sending htaccess auth information through php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-166523@lists.php.net to get a copy of this message | ||
This is what I use. IE is smart enough to parse out the user/pw from the
location bar, so you should be pretty good. FYI, some forms of media may
need this sent too, like mediaplayer -- which is annoying b/c it tries to
authenticate! Bastards.
http://$username:$password@www.mysite.com/protected/
And for media, try this...
http://$username:$password@www.mysite.com/protected/mymovie.wmv
Daevid Vincent
http://daevid.com
> -----Original Message-----
> From: daniel@electroteque.org [mailto:daniel@electroteque.org]
> Sent: Wednesday, October 15, 2003 7:06 PM
> To: php-general@lists.php.net
> Subject: [PHP] Sending htaccess auth information through php
>
> Hi there, i was wondering if there was a way to send htaccess auth
> information through php. My application is loading a parent
> flash movie
> which externally loads flash videos within a directory i want
> to password
> protect with htaccess. I was wondering how could it be
> possible to send
> headers to that the parent flash can load the external videos
> without a
> password box popping up ?
>
> Basically there is two solutions. Password protect the
> directory and work
> out a way to get flash to load the flash videos without a password box
> popping up.
>
> Or doing a fopen and fread on flash files outside the web
> directory like so.
>
> header("Content-type: application/x-shockwave-flash");
> $fp = @fopen("/path/".$_GET['filename'],"r");
> $swf = @fread($fp,filesize("/path/".$_GET['filename']));
> @fclose ($fp);
> echo $swf;
>
> This will output the binary information, then the parent
> flash loads that
> php file with the filename into a movie container. It works but is it
> slower than the first solution ?
>
> Let me know.
>
> Dan
> (whos punctuation is hopefully better than in the past)