-
Notifications
You must be signed in to change notification settings - Fork 0
/
signUp.php
32 lines (30 loc) · 853 Bytes
/
signUp.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
<?php
include_once 'common.php';
$dbuser = 'root';
$dbpass = '';
$db = new PDO('mysql:dbname=php3_test;host=localhost',$dbuser,$dbpass);
$login = '';
$password = '';
if(! empty($_POST) && isset($_POST['login']) && isset($_POST['password']))
{
$login = $_POST['login'];
$password = $_POST['password'];
$sql = "SELECT * FROM users WHERE login = :login AND pass = :password;";
$assocStat = $db->prepare($sql);
$assocStat->bindParam(':login', $login);
$assocStat->bindParam(':password', $password);
$res = $assocStat->execute();
$data = $assocStat->fetchAll();
pr($data);
}else
{
p("in get arr error");
}
?>
<form action="" method="post">
<input type="text" name="login"/>
<input type="password" name="password"/>
<input type="submit" name="send"/>
<a href="reg.php">registration</a>
</form>
<?