Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PHP mySQL and directory protection

 
   Database Forums (Home) -> PHP RSS
Next:  web mail like MS OWA  
Author Message
davidshook

External


Since: Sep 07, 2003
Posts: 4



(Msg. 1) Posted: Tue Aug 17, 2004 9:47 pm
Post subject: PHP mySQL and directory protection
Archived from groups: alt>php (more info?)

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.

 >> Stay informed about: PHP mySQL and directory protection 
Back to top
Login to vote
steve




Joined: Jan 06, 2004
Posts: 660



(Msg. 2) Posted: Wed Aug 18, 2004 12:39 am
Post subject: Re: PHP mySQL and directory protection [Login to view extended thread Info.]

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: http://www.phpbuilder.com/columns/tim20000505.php3

 >> Stay informed about: PHP mySQL and directory protection 
Back to top
Login to vote
davidshook

External


Since: Sep 07, 2003
Posts: 4



(Msg. 3) Posted: Wed Aug 18, 2004 7:34 am
Post subject: Re: PHP mySQL and directory protection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
file protection -

Hidden directory - Hi everyone, I'm running php on win2000 server and iis. I have a script that builds the directory sturcture of a directory or a drive. My problem is that i want to find that which directories are hidden. I have looked stat() function but it seems that i...

PHP and Active Directory - Hi I'm trying to get it so visitors to our intranet site are able to log into the site with there normal login details. On a network using win2k3, active directory etc. Now my code at the moment seems to connect to AD but it fails when it trys to bind....

PHP and Active Directory - Hi I'm trying to get it so visitors to our intranet site are able to log into the site with there normal login details. On a network using win2k3, active directory etc. Now my code at the moment seems to connect to AD but it fails when it trys to bind....

PHP and Active Directory - Hi I'm trying to get it so visitors to our intranet site are able to log into the site with there normal login details. On a network using win2k3, active directory etc. Now my code at the moment seems to connect to AD but it fails when it trys to bind....
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]