-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunos.php
36 lines (27 loc) · 842 Bytes
/
unos.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
<?php
session_start();
$con=mysqli_connect('localhost','root','','');
mysqli_select_db($con,'seminar_pzi');
$name=$_REQUEST["username"];
$password=$_REQUEST["password"];
$mail=$_REQUEST["mail"];
$ponovi=$_REQUEST["repeat"];
$telefon=$_REQUEST["telefon"];
$s="select * from register where username='$name' or mail='$mail' ";
$result=mysqli_query($con,$s);
$num=mysqli_fetch_array($result);
if($num >0 ){
echo "<div>alert('Korisnicko ime ili mail vec postoji');</div>";
header('location:registration.php');
}
else if(($ponovi != $password)){
echo"Unesene lozinke nisu iste";
header('location:registration.php');
}
else{
$reg="insert into register(username,mail,telefon,password) values('$name','$mail','$telefon','$password')";
mysqli_query($con,$reg);
echo"Uspjesno";
header('location:login.php');
}
?>