rogerios Posted May 29, 2006 Share Posted May 29, 2006 Hi.I have chosen to protect my website using .htaccess since I use a LeftFrame for navigation, and a MainFrame to load PDF Documents.Now, I have three different sites, and, I need a 'User Manager' interface which allows the admin to control user access to any combination of these sites. I have actually used a global PHP login, which provides respective access to a PHP file with this line only:header("Location: [a href=\"http://username:password@website_X");\" target=\"_blank\"]http://username:password@website_X");[/a]* That would forward the user and somewhat secretly bypass the browser's request for a new password. Since IE now prohibits passwords within URLs by default, this can no longer be achieved...The question is, how can I protect those PDF documents and authenticate via PHP, using a MySQL database to keep track of user details?Does $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] have anything to do with .htaccess? Could this be an alternative?Thank you :)Roger Quote Link to comment https://forums.phpfreaks.com/topic/10721-using-php-to-bypass-htaccess/ Share on other sites More sharing options...
rogerios Posted May 31, 2006 Author Share Posted May 31, 2006 To answer my own question (after more research).This can be achieved with these lines:<?php$pdf = 'dummy.pdf';header('Content-type: application/pdf');//header('Content-Disposition: attachment; filename="'.$pdf.'"');readfile($pdf);?>...just in case anyone else is searching on this topic :) Quote Link to comment https://forums.phpfreaks.com/topic/10721-using-php-to-bypass-htaccess/#findComment-40550 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.