Jump to content

checking a users login information


CircularStopSign

Recommended Posts

[code]
<?php
$password = "mypass"
$username = "user123"

$strqry = "SELECT * FROM users WHERE password = '{$password}' AND username = '{$username}'";
$query = mysql_query($strqry) or die("MySQL Error: <br />{$strqry} <br /> ". mysql_error());
$num = mysql_num_rows($query);

if ($num < 1) {
  // Password User not found in database or do not match
} else {
  // Password/username is valid
  header("Location: login_success.php");
  exit();
}
?>
[/code]

Gives you the jist of it :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.