Ask a Question related to PHP Programming, Design and Development.
-
Marek Kilimajer #1
Re: [PHP] Restricted access
Yes, put the files outside of web root or protect them using .htaccess
file. After authorization use readfile90 to serve the file. There are
lots of tutorials on authentization and if you are using some CMS you
might have all you need.
Ciprian Trofin wrote:
> Hi All,
>
> I want to give access to resources (PDFs and some RTFs) only to registered
> users and I also want to deny that kind of access to people that "guess"
> the URL. I guess it is all about putting these files outside the web-tree
> and somehow putting PHP to work.
>
> Could you enlighten me ?
)
>
> --
> Thnx,
> Cip
>
>Marek Kilimajer Guest
-
Webservice with restricted ip access
I've consumed a webservices that will only accept connection from my servers IP address and a password. When I run the file locally on the server... -
Restricted to Page
I am building a login page by following the Part 2: http://www.macromedia.com/devnet/mx/dreamweaver/articles/php_blog2.html. I'm using Windows... -
Time restricted access to folder?
Hello I wonder if there is a way when using .htaccess /.htpasswd to restrict access to a web site folder for a limited time, eg 0.5 hr? Cheers... -
Problem with web.config access-restricted subdirectory
Hi, I have a problem with web.config unsuccessfully controlling access to a subdirectory. I'm using VS03 and IIS5.0 on NT2K. I have been able... -
Unable to access Tools/Internet Optios in I.E. - Restricted
Am using XP-Pro with two accounts the first as an administrator and the second as a user (Both accounts having different names) While using I.E... -
Ciprian Trofin #2
Restricted access
Hi All,
I want to give access to resources (PDFs and some RTFs) only to registered
users and I also want to deny that kind of access to people that "guess"
the URL. I guess it is all about putting these files outside the web-tree
and somehow putting PHP to work.
Could you enlighten me ?
)
--
Thnx,
Cip
Ciprian Trofin Guest
-
Kae Verens #3
Re: Restricted access
Ciprian Trofin wrote:
[url]http://php.net/fpassthru[/url] is the answer to the web-tree problem.> Hi All,
>
> I want to give access to resources (PDFs and some RTFs) only to registered
> users and I also want to deny that kind of access to people that "guess"
> the URL. I guess it is all about putting these files outside the web-tree
> and somehow putting PHP to work.
>
> Could you enlighten me ?
)
>
The authentication is a different matter. I have my own method - I'm
sure others have other/better methods.
Kae
Kae Verens Guest
-
Ciprian Trofin #4
Re: [PHP] Restricted access
What is readfile90 ? I tried google and nothing.
MK> Yes, put the files outside of web root or protect them using .htaccess
MK> file. After authorization use readfile90 to serve the file. There are
MK> lots of tutorials on authentization and if you are using some CMS you
MK> might have all you need.
>> I want to give access to resources (PDFs and some RTFs) only to registered
>> users and I also want to deny that kind of access to people that "guess"
>> the URL. I guess it is all about putting these files outside the web-tree
>> and somehow putting PHP to work.Ciprian Trofin Guest
-
Marek Kilimajer #5
Re: [PHP] Restricted access
I'm sorry, should be readfile(). Switched keyboard.
Ciprian Trofin wrote:
> What is readfile90 ? I tried google and nothing.
> MK> Yes, put the files outside of web root or protect them using .htaccess
> MK> file. After authorization use readfile90 to serve the file. There are
> MK> lots of tutorials on authentization and if you are using some CMS you
> MK> might have all you need.
>
>>>>>I want to give access to resources (PDFs and some RTFs) only to registered
>>>users and I also want to deny that kind of access to people that "guess"
>>>the URL. I guess it is all about putting these files outside the web-tree
>>>and somehow putting PHP to work.
>
>Marek Kilimajer Guest
-
Scott Fletcher #6
Re: Restricted access
There is a easier way, I use this all the time and I don't have a problem
with it. Sometime the header() need some tweaking to make it work right.
You must include an exit() function after the header() due to bugs and bugs
in IE. This script below is what I use for file download. Instead of file
download, you can easily tweak the header to any of other things like
display PDF without knowing where hte real file is...
--snip-- "HTML Link"
echo "<a href='$PHP_SELF?dw_code=0'>\n";
--snip--
--snip-- "PHP Script"
//Script for File Download... (DP, Temp, etc...)
//(1st --> Original File (File on Server)...
//(2nd --> Renamed File & Fake File Path (Browser Download)...
//(3rd --> Hyperlink (Display Comment)...
$DownloadUpdateArray[0] = array('update\setup.exe','setup.exe','Special
Feature Update 1.0');
if (strlen(trim($_REQUEST['dw_code']))!=0) {
//Send Downloadable File(s) To Browsers...
$file=$DownloadUpdateArray[$_REQUEST['dw_code']][0];
header ("Pragma: public");
header ("Expires: 0"); // set expiration time
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header ("Content-Type: application/force-download");
header ("Content-Type: application/octet-stream");
header ("Content-Type: application/download");
header ("Content-Disposition: attachment;
filename=\"".$DownloadUpdateArray[$_REQUEST['dw_code']][1]."\";");
header ("Content-Length: ".filesize($file));
header ("Content-Transfer-Encoding: binary");
//Can't use readfile() due to poor controling of the file download.
//(IE have this problems)...
//readfile($file);
//use fopen() instead of readfile...
$fp = fopen($file, 'rb');
$content = fread ($fp, filesize($file));
fclose ($fp);
print $content;
}
//Required, to keep IE from running into problems
//when opening the file while downloading or downloading...
//(IE been acting strange lately...)
exit();
}
--snip--
"Kae Verens" <kverens@contactjuggling.org> wrote in message
news:20030814123110.72614.qmail@pb1.pair.com...registered> Ciprian Trofin wrote:> > Hi All,
> >
> > I want to give access to resources (PDFs and some RTFs) only toweb-tree> > users and I also want to deny that kind of access to people that "guess"
> > the URL. I guess it is all about putting these files outside the>> > and somehow putting PHP to work.
> >
> > Could you enlighten me ?
)
> >
> [url]http://php.net/fpassthru[/url] is the answer to the web-tree problem.
>
> The authentication is a different matter. I have my own method - I'm
> sure others have other/better methods.
>
> Kae
>
Scott Fletcher Guest
-
KLOCO #7
Restricted access
Two problems the first is the easiest. When I click on home a new page opens
instead of going back to the opened homepage. The second is a bit more
complicated. I want to allow clients to log in and access their own pages and
not others. Site is: [url]www.kloco.net[/url] go to project>Emma or any link. Every thing
is behind the login and that is as far as anyone can go
I have all the files and plug-ins and programs that help suggests. The login
page is ASP Net page I have: ISS, .Net Framework 1.1 and SDK, and SQR Express.
When I press the + and select dataset, it says that no table found (I have an
access .mdb in the root folder) and then asks for ?select statement. I am lost.
I want to allow clients to access there own pages and not others.
KLOCO Guest
-
jeremyluby #8
Re: Restricted access
First Queston: You probably have target="_blank" in the <a> tag. Remove this.
Second Question: You will need to create a DB connection to your database
jeremyluby Guest



Reply With Quote

