-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck2.php
More file actions
37 lines (30 loc) · 866 Bytes
/
check2.php
File metadata and controls
37 lines (30 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include ("top.php");
?>
<?php
$pass = md5($_POST['passwd']);
?>
<p>
You entered ID <strong><?php echo $idnum; ?></strong>
and password <strong><?php echo $passwd; ?></strong><br />(<?php echo $pass; ?>).
</p>
<?php
$dbHost = "";
$dbUser = "";
$dbPass = "";
$dbDatabase = "";
$db = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die ("Error connecting to database.");
mysql_select_db("$dbDatabase", $db) or die ("Couldn't select the database.");
$result=mysql_query("select * from users where userid='$idnum' AND passwd='$pass'", $db);
if (!$result) { die('Invalid query: ' . mysql_error()); }
$rowCheck = mysql_num_rows($result);
if($rowCheck > 0) {
echo "<p><em>ID / Password OK.</em></p>";
}
else {
echo "<p><em>WRONG!</em></p>";
}
?>
<?php
include ("bottom.html");
?>