Current location: Hot Scripts Forums » Programming Languages » PHP » mysql multi user login for restricted pages


mysql multi user login for restricted pages

Reply
  #1 (permalink)  
Old 12-04-04, 02:33 PM
giano giano is offline
New Member
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mysql multi user login for restricted pages

I have a few questions, if some one could help me with.

First, please understand, I am very new to this, I would like to know if there is a script to limit each user per page by user name and password, if so how?

Lets say I have a photo gallery with multiple galleries, gallery being the main folder, and inside "gallery" were subdirectories such as Johnny, Betty and James, and I only want certain users to access certain galleries based off user name and password or some other means.

Also how would I tell the script if Johnny logs in go to this page, once Betty logs in go to this page?

Thank you,
Giano
Reply With Quote
  #2 (permalink)  
Old 12-04-04, 03:12 PM
wizkid's Avatar
wizkid wizkid is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
I think you can do this:
PHP Code:

switch ($username) {

   case 
"Johnny":
       echo 
"echo <meta http-equiv=\"REFRESH\" Content=\"0; URL= Johnny.php\">";
       break;
   case 
"Betty":
       echo 
"echo <meta http-equiv=\"REFRESH\" Content=\"0; URL= Betty.php\">";
       break;
   case 
"James":
      echo 
"echo <meta http-equiv=\"REFRESH\" Content=\"0; URL= James.php\">";
       break;

Reply With Quote
  #3 (permalink)  
Old 12-04-04, 08:41 PM
CMIVXX's Avatar
CMIVXX CMIVXX is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
The above is probably the simplest of answers, but what kind of authentication are you using? Is it a script you picked up somewhere, or something you created yourself?

Show me a sample of this script and what the output is and I can help you create something.
__________________
--------------
CMIVXX
Reply With Quote
  #4 (permalink)  
Old 12-04-04, 11:01 PM
giano giano is offline
New Member
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Currently I am not using anything.

See that is my problem, I was mainly wondering if there was a script out there that anyone knows of a script that would allow me to let Johnny to login only to his image directory. All of the other login scripts that I have seen are multi user login scripts that allow every one to see each others files, and such. I want single user access to their galleries.

Thank you,
giano
Reply With Quote
  #5 (permalink)  
Old 12-05-04, 07:52 AM
wizkid's Avatar
wizkid wizkid is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Yes this indeed is the simplest of answers. Why give the complex ones if giano himself said:
Quote:
Originally Posted by giano
First, please understand, I am very new to this..
Reply With Quote
  #6 (permalink)  
Old 12-05-04, 08:31 AM
wizkid's Avatar
wizkid wizkid is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Here is a simple idea. Use whatever login script you have or found. Basically, your page1 will ask for a username and password. Once they click enter or whatever, it goes to page2. Page2 validates your username and password. If there is a match, you can now redirect the page to whatever page they should be in using the simple script i provided on my previous post. Just add the necessary parameters that you will use on the other pages.
Reply With Quote
  #7 (permalink)  
Old 12-05-04, 08:47 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
custom php/mysql coding email: jas[at]programmer[dot]net
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #8 (permalink)  
Old 12-07-04, 05:04 AM
giano giano is offline
New Member
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
All of you have been a great help, thank you!!

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP user managment with no mysql markac Script Requests 6 12-06-04 12:14 AM
Login script for MySQL db conundrum PHP 1 07-29-04 09:35 AM
One user per username login session (to prevent username sharing) jdavis7453 ASP 4 05-07-04 10:53 AM
CMS with user private pages psi Script Requests 0 02-12-04 08:29 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM


All times are GMT -5. The time now is 05:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.