Jump to content

jack7076

New Members
  • Posts

    6
  • Joined

  • Last visited

jack7076's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Hello I've written some code that dies when the msql lookup occurs and crashes when an invalid username or password is entered I want the code to continue and go to my invalid page. anyway here is the code: echo "Before Query <br>"; $query = mysql_query("SELECT * FROM user where userName = '$_POST[user]' AND pass = '$pass'") or die(mysql_error()); echo "row"; $row = mysql_fetch_array($query) or die(mysql_error()); echo "Before Login. <br>"; if(!empty($row['userName']) AND !empty($row['pass'])) { if($_POST['user'] = $row['userName'] AND $pass = $row['pass']){ $_SESSION['ID'] = $row['ID']; $_SESSION['user'] = $row['userName']; $_SESSION['rank'] = $row['rank']; header("Location: Index.php"); } else{ header("Location: INVALID.php?ref=login"); } } else { header("Location: INVALID.php?ref=login"); }
  2. Fixed $Users['username'] incorrect corection $Users['userName']
  3. Here in the attached file shows that my users are not showing but activation and deactivation is showing. Please help Thanks in advance -- Jack SRC CODE: I have defined a Conection to my DB @mysql_connect("URL to DB","My user","MY PASS","DB") or die("Failed to connect to MySQL: " . mysql_error()); //List Users mysql_select_db("a4823842_1"); $list_query = mysql_query("SELECT * FROM username"); while($Users = mysql_fetch_array($list_query)){ $u_username = $Users['username']; $u_type = $Users['type']; ?> <tr><td class='listuseradmin'><?php echo $Users['username']; ?></td><td><?php if($u_type == 'a'){ echo '<a href="">Deactivate</a>'; } else{ echo '<a href="">Activate</a>'; } } } ?> </td> </tr> </table>
×
×
  • Create New...

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.