473,503 Members | 11,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

login varification from 2 tables in one form

hello Friends,
I wanted to know is it posible to have one log in window and then
varify the username password from 2 different table in same DB.
that means I have one log in form and then I take info from 2
different tables to varify if the user-pass combination in any of the
table maches to the input values.
My bosss wants me to make soemthign like this, as far as I know its
not posible in PHP but still comfirming

PLease help
thanks
Jaunty
Jul 17 '05 #1
5 1940
I noticed that Message-ID:
<1e**************************@posting.google.com > from Jaunty Edward
contained the following:
I wanted to know is it posible to have one log in window and then
varify the username password from 2 different table in same DB.
that means I have one log in form and then I take info from 2
different tables to varify if the user-pass combination in any of the
table maches to the input values.
My bosss wants me to make soemthign like this, as far as I know its
not posible in PHP but still comfirming


Don't see why it's not possible. I'm not sure /why/ you'd want to do it
that way but there is no problem running multiple queries


--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Geoff Berrow wrote:
I noticed that Message-ID:
<1e**************************@posting.google.com > from Jaunty Edward
contained the following:

I wanted to know is it posible to have one log in window and then
varify the username password from 2 different table in same DB.
that means I have one log in form and then I take info from 2
different tables to varify if the user-pass combination in any of the
table maches to the input values.
My bosss wants me to make soemthign like this, as far as I know its
not posible in PHP but still comfirming

Don't see why it's not possible. I'm not sure /why/ you'd want to do it
that way but there is no problem running multiple queries


table1
id
username

table2
id
password

select a.username,b.password from table1 a, table2 b
where a.id = b.id and
a.username = '$username' and
b.password = password('$password');

If the record set is empty, there is no match and you should re-direct to the
login page.

or even a single query using a simple join. If your boss is thinking about
security, well, anyone that gets access to db would eventually figure out the
entity relationships and still get what they want.

For passwords in MySQL, you can PASSWORD() to encode them. This is a one-way
encryption. In other words you would verify that the encrypted version of the
password passed in on the form is the same as the stored password in the
database and there are no tools/methods to unscramble the password to find out
what the real password is.

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #3
GoL
On 28 Aug 2004 04:18:45 -0700, sm***********@hotpop.com (Jaunty
Edward) wrote:
hello Friends,
I wanted to know is it posible to have one log in window and then
varify the username password from 2 different table in same DB.
that means I have one log in form and then I take info from 2
different tables to varify if the user-pass combination in any of the
table maches to the input values.
My bosss wants me to make soemthign like this, as far as I know its
not posible in PHP but still comfirming

PLease help
thanks
Jaunty


I don't know if you mean you have the usernames in one table and the
passwords in another table, (in which case you have another answer
here already), or if you want to check against two different tables
with username/password combinations.
In the latter case, it should't be any problem do check against one
table first, and if that fails, check the other.
First match logs you in.

Jul 17 '05 #4
On Sat, 28 Aug 2004 13:56:23 +0000, Michael Austin wrote:
For passwords in MySQL, you can PASSWORD() to encode them. This is a
one-way encryption. In other words you would verify that the encrypted
version of the password passed in on the form is the same as the stored
password in the database and there are no tools/methods to unscramble the
password to find out what the real password is.


Actually, according to the MySQL documentation, we should _not_ use
PASSWORD() to encrypt passwords. The implementation (and therefore the
results) may change between versions of MySQL (indeed this has already
happened). Instead Use a standard hashing function such as SHA1 or MD5.
Be sure your password field is "binary" and is long enough to hold the
result of whatever hashing function you decide on(40 or 32 bytes,
respectively).

HTH,
La'ie Techie

Jul 17 '05 #5
Lāʻie Techie wrote:
Be sure your password field is "binary" and is long enough to hold the
result of whatever hashing function you decide on(40 or 32 bytes,
respectively).


Rather, you should ensure your password field is a VARCHAR/CHAR field
with length 40 or 32. The MySQL functions SHA1 and MD5 in current
implementations return 40- and 32- character strings - the hexadecimal
representation of the binary value - rather than the raw binary value.

--
Jasper Bryant-Greene
Cabbage Promotions
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2957
by: Simon | last post by:
Hi, I have a Login.php page that logs the user in and out. I has two forms within the page, (depending on what we are trying to do), either one to log in or out. The form calls itself using a...
3
9492
by: Rudi Groenewald | last post by:
Hi there... I use SQL server integrated security so when a user opens a database in access it prompts the username & password in a small popup box on connection, but I'd like to use my own...
2
1695
by: doctorfeelyg | last post by:
Hi there, Im relatively new to access so please forgive any ignorance. Here is my, rather long-winded, plea for help: I have a main table which contains a list of projects and associated...
2
1423
by: blue875 | last post by:
I have created an Access DB and a new MDW file where I have admin privileges. I have several tables and a form that interacts with them. When I click the "Submit" button on the form, I have it...
1
3044
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. Im a freelance and a newbie in web application development. Im currently using ASP as my application...
2
1921
by: dylanhughes | last post by:
I'm looking for an example of a login system that has multiple fields (2 to be exact) + password. e.g username, company name and password, the user, company and password are checked against a mysql...
2
1414
by: cybermom | last post by:
Hi another newbie here I am trying to get the message: The you entered is a leap year, but it does not happen, what did I do wrong with this script? <html> <HEAD> <SCRIPT...
38
3245
by: Sanders Kaufman | last post by:
I'm converting my table-based layouts to css-positioned divs - but the ONLY reason I'm doing it is because it's *considered* a best practice. I don't really see where anything goes hinky when...
9
7502
by: adweaver | last post by:
Hello All, I'm new to the world of php. I've just had a site designed for me by a company, and I'm now trying to manage and grow it, so it will suit my needs. The site was built in a folder...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.