-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregis.php
More file actions
35 lines (29 loc) · 842 Bytes
/
regis.php
File metadata and controls
35 lines (29 loc) · 842 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
<?php
$servername ='localhost';
$username='root';
$password='';
$dbname='base1';
$con= new mysqli($servername,$username,$password, $dbname);
if ($con->connect_error){
die('error');
}
$uName = $_POST['login'];
$ps = $_POST['ps'];
$fn = $_POST['fn'];
$ln = $_POST['ln'];
$au = 2;
$sql="SELECT * FROM users ";
$result=$con->query($sql);
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
if($row['login']==$uName){
echo 'false';
exit;
}
}
require 'db_connect.php';
$db = new DB_CONNECT();
$sql = "INSERT INTO `users` (`user_id`, `login`, `password`, `first_name`, `last_name`, `group_au`, `date_creation`) VALUES (NULL, '$uName', '$ps', '$fn', '$ln', '$au', CURRENT_TIMESTAMP);";
mysql_query($sql) or die(mysql_error());
echo 'notexist';
}