Re: php login

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Stokes wrote:
Hello,

I need to create solution for user authentication/recognition in my web
page. I think it would be a good idea to use mysql database for storing the
user info because the user info is later used to determine what parts of
site the recognized user is allowed to update.

Sounds like a fine idea to me.


The site is for a soccer club that has some 30+ teams. I want to give each team the ability to update their own information but I don't want them to be able to mess with others info. So each team has one named "admin" to whom I need to give the access to their team info.

I'm willing to learn to write my own scripts if I can get some info how
these things are normally handled or I can use free ready scripts if someone
can reccoment me one


The basic process might go something like this: - Create the user database - Build DB so that each user record needs a unique ID (auto-increment number is usually best), a team name, user type (user / admin), and password - Create a login function (user / password) - Query the user database; see if password matches stored password - If login succeeds: - Start session: session_start() - Store username / team / user type in $_SESSION - Go to team home page (or whatever) - If login fails: - Redirect user to the login page - Create all of the individual web pages you want (show team / edit team / etc.) - At the beginning of each web page you check for the user type in $_SESSION. Also, check for the user team in $_SESSION. - If the user isn't the required team / user type then send an error message to the user

Rough outline, but this should be enough to get you started and to let
you know which parts of the manual you will need to read.  ;)

http://www.php.net/manual/en/index.php


BTW I am quite rookie with PHP.

Thanks a lot
-Will


--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux