#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    4
    Rep Power
    0
    Hi,

    Anyone that could help me out is greatly appreciated!

    Here's my snippet of code:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    IF ($hostpassword && $oldname != '$hostpass' && '$hostcall') :
    PRINT "<CENTER><P>Wrong Password! </CENTER>";
    ELSE :
    $query = "UPDATE $userstable SET hostcall = '$newname' WHERE hostcall = '$oldname'";
    MYSQL_QUERY($query);
    ENDIF;
    [/code]

    Now $hostpassword and $oldname are fields I pulled from a form. But this doesn't work!

    Basically, I am trying to let a user update a table field only if his password is correct.
    Anyone know how to fix this, or an easier way to do this?
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    Is this what you mean??

    if ($hospassword!=$hostpass &#0124; &#0124; $oldname!=$hostcall)

    What you are saying (in English)

    if hostpassword is true AND oldname is equal to the string '$hostpass' AND the string '$hostcall' is true then...

    You don't want the single quotes and you need to match the elements with your operator !=
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    4
    Rep Power
    0
    Thanks Rod, but not exactly,

    Each user has a hostpass and a hostcall.
    So what I am trying to do is:

    If hostpassword equals the hostpass AND oldname equals hostcall, then allow him to update the table.

    So, know of anyway I can do that?
  6. #4
  7. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    you can try the following:

    if(($hospassword==$hostpass) && ($oldname==$hostcall)){

    //allow him to update table..
    }

    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited October 06, 2000).]

Similar Threads

  1. MySQL password problems NOT root
    By braveheart in forum MySQL Help
    Replies: 2
    Last Post: February 15th, 2004, 08:18 AM
  2. password generation on user auth.
    By nacho_c in forum PHP Development
    Replies: 14
    Last Post: January 16th, 2004, 04:55 AM
  3. Replies: 1
    Last Post: January 7th, 2004, 06:41 PM
  4. want password protect?
    By CaptinKirk in forum Beginner Programming
    Replies: 4
    Last Post: December 18th, 2003, 12:00 PM
  5. changing password in a file
    By pinak in forum PHP Development
    Replies: 1
    Last Post: September 30th, 2003, 09:31 PM

IMN logo majestic logo threadwatch logo seochat tools logo