Results 1 to 5 of 5
  1. #1
    Newbie Affiliate Ian's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,540
    Authenticaitng 2 vlues instead of 1
    ok, with the help of users here last week, I am able to get PHP to authenticate 1 value (pw) from my table. Now I need to take it to the next step and check for 2 values (pw+userid) the end user enters. How can I modify these codes to do that? Any help would be greatly appreciated!

    *******
    if (!($result = mysql_db_query($DB, "select pw from wb_auth where pw='$pw'"))) {
    echo "could not run query"; //query failure, not no result found
    exit();
    }

    if (mysql_num_rows($result)==0){
    echo "nope';
    die();
    }else{
    while ($row=mysql_fetch_array($result)){
    echo "yes";
    }
    *******

  2. #2
    ABW Ambassador cditty's Avatar
    Join Date
    January 18th, 2005
    Location
    Memphis TN
    Posts
    1,434
    where pw='$pw' and userid = '$userid'

    Should do the trick.
    Recycled Talent - Architects of custom scripts and snippets, perfectly written to suit any need. We stay on top of the latest technology so you don't have to.
    Total Stupidity - Shining light on stupid things.

  3. #3
    Newbie Affiliate Ian's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,540
    when I switch $pw & $userid, it works. But that only allows me to authenticate 1 value. I want to ler users through only if PW + UserID is valid. Any ideas?

  4. #4
    ABW Ambassador cditty's Avatar
    Join Date
    January 18th, 2005
    Location
    Memphis TN
    Posts
    1,434
    Right. You would use the where statement I provided above. Just make the userid and $userid match your settings. This will only return records where userid AND pw match.
    Recycled Talent - Architects of custom scripts and snippets, perfectly written to suit any need. We stay on top of the latest technology so you don't have to.
    Total Stupidity - Shining light on stupid things.

  5. #5
    Newbie Affiliate Ian's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,540
    Sorry cditty, even thogh it's just one line, it took me a little while to digest the codes. Fantastic, it worked!

    Thanks a million!!!

  6. Newsletter Signup

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •