-
Notifications
You must be signed in to change notification settings - Fork 0
/
databaseCreate.php
56 lines (54 loc) · 1.3 KB
/
databaseCreate.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<html>
<head>
<title>
MySQL Database Admin
</title>
</head>
<body>
<style type="text/css">
body{ position="center"}
</style>
<?php
if($_POST['submitted'])
{
$user = $_POST['username'];
$password = $_POST['password'];
$connection = mysql_connect("localhost", "root", "") or die(mysql_error());
$database = "showstop";
mysql_select_db($database, $connection) or die(mysql_error());
$data = mysql_query('SELECT password FROM login WHERE username = \''.$user.'\';');
function wrong()
{
}
if (!$data)
{
wrong();
}
while($row = mysql_fetch_row($data))
{
if ($row[0]==$password)
{
print "logged in";
}
else
{
print 'incorrect username/password <br>';
print '<a href="http://localhost/messageBoard.htm">Retry</a>';
}
}
/*mysql_query('INSERT INTO login(username, password) VALUES(\''.$user.'\', \''.$password.'\');', $connection) or
header("Location: http://localhost/messageBoard.htm");
print 'Data stored';
$data = mysql_query('SELECT * FROM products', $connection) or die("Could not read from the DB");
while ($row = mysql_fetch_row($data))
{
foreach ($row as $field)
{
print $field." ";
}
print "<br>";
}*/
}
?>
</body>
</html>