steve wrote in message ...
> "davidshook" wrote:
> > I have protected (with .htaccess) directory full of videos and
> files.
> > How do I create a user log-in (authentication) script using
> php/mysql.
> > the problem is:
> > - I don?t want to create a new entery in the .htaccess/password
> > file
> > for each user.
> >
> > Here is a wrking example:
> >
> > user goes to Index.php and click a link for video
> > link points to video.php (video.php is not in protected directory)
> > video.php has an embeded video (videofile.wmv) and also has text
> > description of the video.
> > if the videofile.wmv is not restricted, user gets to see the video
> and
> > the description text.
> > else if the videofiel.wmv is restricted, user gets a prompt for
> > username/password. if the user has no login info he only gets to
> see
> > the description text and a text asking him to subscribe/register.
> >
> > The reason I am trying to avoid creating an entery in the .htaccess
> > for each user is that I was told that after a few hundred enteries
> the
> > access and reading of the .htaccess is slowed.
> > Also, with the .htaccess I have no way of tracking which user are
> > logged in and if 2 different users are using the same password;
> also
> > it is difficult to log out user and keep tract of which videofiles
> the
> > prefer watching/downloading.
>
> David, IMO you are asking for a very standard login process. I
> searched on google using "php user login tutorial", and found the
> following which looks excellent:
<font color=purple> > <a rel="nofollow" style='text-decoration: none;' href="http://www.phpbuilder.com/columns/tim20000505.php3</font" target="_blank">http://www.phpbuilder.com/columns/tim20000505.php3</font</a>>
I think you mis-understood my question.
I can find tons of info about how to user authenticate and prevent
access to a PHP FILE. But, how do I use php and mysql to prevent free
access to a directory?
For example: what do I do if a user types the direct URL to a video
file?
(Now, before you tell me about the .htaccess methode... as I mentioned
in the original post, I don't want to have a new entery in the
htaccess file for each visitor. -- because that method is very
taxing-- it uses a flat file mechanism).
>> Stay informed about: PHP mySQL and directory protection