Problem handling SQL

This is a discussion on Problem handling SQL within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am also a newbie. My goal is to check if a entered username and password match those in a ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-05-2006
John Olav
 
Posts: n/a
Default Problem handling SQL

I am also a newbie. My goal is to check if a entered username and password
match those in a MySQL db (it's a lot of different users). On each row in
the db every user has an access-level (totally two different levels).
How to check whether a entered username and password fits those in the db
(in the actual row) and if they match, how to redirect them to the specific
user level?
I'm thinking of something like (IF (entered) customer_id = true AND
(entered) customer_name = true, THEN redirect to the granted access_level.

db-name: userbase
table:users
field:customer_id (user name)
field:customer_name (password)
field: access_level (value "10" or "20" - associated with one of two
different urls)

Any help would be highly appreciated.


Reply With Quote
  #2 (permalink)  
Old 04-06-2006
Steffen
 
Posts: n/a
Default Re: Problem handling SQL

Hi John,

i think this tutorial can help you very much.

http://www.free2code.net/plugins/art...read.php?id=99

Reply With Quote
  #3 (permalink)  
Old 04-06-2006
Duderino82
 
Posts: n/a
Default Re: Problem handling SQL

the tutorial is fine...but I don't like the solution for the encrypted
password (personally I use MD5 encryption directly in MySql)...and it
doesn't answer the problem of the acces_level. I now it's kind of
simple after you have the login procedure written down to ad this
feature. Anyway as the tutorial explains you can do a check_login.php
file to include in the top of each page and maybe whats best for you is
a function that checks the login and returns the acces_level. Once you
have the access_level you can handle what to show the user or not. It's
not so difficult you just need to try out some solutions. On the
internet there are many tutorials about login procedure!

Reply With Quote
Reply


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

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



All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0