Jump to content

gnetuk

Members
  • Content Count

    50
  • Joined

  • Last visited

Community Reputation

0 Neutral

About gnetuk

  • Rank
    Regular Member

Profile Information

  • Gender
    Not Telling
  1. gnetuk

    IF Statements

    ////////////////////////////////////phyco copy right } else $pwd = ($_POST['pwd']); $query = "SELECT empid FROM users WHERE $pwd='empid'"; $result = mysql_query($query); if ($pwd=$result) { header("Location: setpass.php?msg=ERROR: you dont have the password...."); }else sorry to spam this is working now as long as the first charickor in the empid field has one letter it will work is it my sql table that's causing the problem?
  2. gnetuk

    IF Statements

    im not sure whats happening but if my password is 1 thats the only time it will not ask to change the pass.
  3. gnetuk

    IF Statements

    also i have noticed that it will only work if there employee id = 1 the number any tother number or letter makes the setpass.php load and that sould only load if there password matches the empid.
  4. gnetuk

    IF Statements

    varchar(200) latin1_general_ci No is this it?
  5. gnetuk

    IF Statements

    Oh this is only working for letter atm, and not numbers.
  6. gnetuk

    IF Statements

    couldn't paste all that that I wrote gona get me a beer. this forum is ace love it!!!!!!!!!!!!!
  7. gnetuk

    IF Statements

    ////////////////////////////////////phyco copy right }else $pwd = ($_POST['pwd']); $query = "SELECT empid FROM users WHERE empid=$pwd"; $result = mysql_query($query); if(!mysql_num_rows($result)) { header("Location: setpass.php?msg=ERROR: you dont have the password...."); }else //Password matches an employee ID thanks to phyco//////////////////////////////////////////// //this forum is the best, ill be honest I know very little about //php apart from asking you guys for code I do understand but its //hard for me as I can only read it atm im still gona plod along //best I can.......... //Phyco you did it here's my bit I added that worked (and I wont //be lazy education like u gave is far better than someone just //handing it me on a plate)
  8. gnetuk

    IF Statements

    } $pwd = ($_POST['pwd']); $qry = "SELECT empid FROM users WHERE empid='{$pwd}'"; $sql = mysql_query($qry); $res = mysql_fetch_array($sql); if($res['pwd'] != 1){ header("Location: setpass.php?msg=ERROR: you dont have the password...."); }else // all this dose it make evey user whos empid dose not match goto the setpass.php (I only want users that match to go to promt them to change threre password) { header("Location: myaccount.php"); } //echo "Logged in..."; Hi when the user enters there password in the pwd field I need the sql to check the empid in the database (this is not md5 encrypted) then if the empid = the post password they enterd then it will goto the promt to change the password.
  9. gnetuk

    IF Statements

    you got it bro the password is there empid but they should be promped to change it at first login, no flaws in anyones code here but I sill not getting my desired result.
  10. gnetuk

    IF Statements

    hi im going to try it out but its if the empid maches the password they use to login with basicly the user registerd there password is there empid then when they login with there $_post pwd wich is not in md5 format if it is the same as empd then togo to the setpass page. see what I mean the md5 will always be encrypted that's a seprrate field in my db
  11. gnetuk

    IF Statements

    $md5pass = md5($_POST['pwd']); $selectuser="SELECT empid FROM users WHERE empid='$_POST[pwd]'"; $selectuser2=mysql_query($selectuser); $selectuser3=mysql_fetch_array($selectuser2); if ($selectuser3[empid]=$_POST['pwd']) { //die ("ERROR: password is empid."); header("Location: setpass.php?msg=ERROR: you dont have the password...."); } That's was not code that was just what I wanted to do I cannot write code as im self teached php here is my code
  12. gnetuk

    IF Statements

    Hi all Its me again, I been trying to get this to work for ages now on my own with no joy so I gona need a lttle help Ok I have a login page and I want the page to login and redirect to another page if the password matches a certern field. IF $_POST[pwd] = empid then goto setpass.php Just need the code as my coding is not working
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.