-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanditregistrationcode.php
More file actions
46 lines (44 loc) · 1.82 KB
/
panditregistrationcode.php
File metadata and controls
46 lines (44 loc) · 1.82 KB
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
<?php
session_start();
include("admin/config/dbcon.php");
if (isset($_POST['submit'])) {
$pfname = $_POST['txtpfname'];
$plname = $_POST['txtplname'];
$pemail = $_POST['txtpemail'];
$ppass = $_POST['txtppass'];
$pdetails = $_POST['txtpdetails'];
$pphno = $_POST['txtpphno'];
$pdoj = $_POST['txtpdoj'];
$pstate = $_POST['txtpstate1'];
$pcity = $_POST['txtpcity1'];
$pimage = $_FILES['pimage'];
$filename = $_FILES['pimage']['name'];
$temp = $_FILES['pimage']['tmp_name'];
if ($filename != '') {
move_uploaded_file($temp, 'image/' . $filename);
}
if ($ppass == $pconpass) {
$qry = "select email from pandit where email='$pemail'";
$result = $con->query($qry);
$count = mysqli_num_rows($result);
if ($count > 0) {
$_SESSION['message'] = "Email Already Exiist";
echo "<script type='text/javascript'>window.top.location='panditregistration.php';</script>";
} else {
$qry1 = "INSERT INTO `pandit`( `fname`, `lname`, `email`, `password`, `pdetails`, `phno`, `doj`, `state`, `city`, `pimage`,`status`) VALUES ('$pfname','$plname','$pemail','$ppass','$pdetails','$pphno','$pdoj','$pstate','$pcity','$filename','pending')";
$result1 = $con->query($qry1);
if ($result1) {
// echo "pass";
$_SESSION['message'] = "Registration Successfully";
echo "<script type='text/javascript'>window.top.location='login.php';</script>";
} else {
// echo "failed";
$_SESSION['message'] = "Failed to register";
echo "<script type='text/javascript'>window.top.location='panditregistration.php';</script>";
}
}
} else {
echo "Confirm Password and Password didn't Match";
}
}
?>