-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathta.php
More file actions
64 lines (51 loc) · 945 Bytes
/
ta.php
File metadata and controls
64 lines (51 loc) · 945 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$mysqli=new mysqli("localhost","root","","sc");
error_reporting(0);
$userName = $_POST['logg'];
if ($userName==NULL)
{
?>
<script>
alert('Username Cannot Be Empty');
window.location='admin.php';
</script>
<?php
}
//$email = $_POST['ml'];
$password = $_POST['pass'];
if ($password==NULL)
{
?>
<script>
alert('Password Cannot Be Empty');
window.location='admin.php';
</script>
<?php
}
$sql1="select * from teacher where uname='$userName'";
$data1 = $mysqli->query($sql1);
$row=$data1->fetch_array();
if($row==0)
{
$sql2 = "INSERT INTO teacher (uname,pass) VALUES ('$userName','$password')";
$data = $mysqli->query($sql2);
if ($data)
{
?>
<script>
alert('Registration Successful');
window.location='admin.php';
</script>
<?php
}
}
else
{
?>
<script>
alert('Registration Failed Username already exist');
window.location='admin.php';
</script>
<?php
}
?>