This is a discussion on Sending htaccess auth information through php within the PHP General forums, part of the PHP Programming Forums category; This is what I use. IE is smart enough to parse out the user/pw from the location bar, so ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|