-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdbh_ass.php
54 lines (41 loc) · 1.04 KB
/
dbh_ass.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
<?php
$dbServername="sql302.epizy.com";
$dbUsername="epiz_25239751";
$dbPassword="moni37230559";
$dbName="epiz_25239751_cman";
// $dbServername="localhost";
// $dbUsername="root";
// $dbPassword="";
// $dbName="cman";
$conn=mysqli_connect($dbServername,$dbUsername,$dbPassword,$dbName);
$fname=$_POST['fname'];
$sname=$_POST['sname'];
$gender=$_POST['gender'];
$email=$_POST['email'];
$mobile=$_POST['mobile'];
if (isset($_POST['register'])) {
$query ="select * from visitors where mobile ='$mobile';";
$result=mysqli_query($conn,$query);
$count=mysqli_num_rows($result);
if ($count>0)
{
?>
<script type="text/javascript">
alert("User already Exist!!");
window.location= "associates.php";
</script>
<?php
}
else{
$sql= "insert into visitors(fname,sname,Gender,email,mobile)
values('$fname','$sname','$gender','$email','$mobile');";
mysqli_query($conn, $sql);
?>
<!-- js pop up -->
<script type="text/javascript">
alert("Registration Successful!!");
window.location= "associates.php";
</script>
<?php
}
}