forked from Bhanu-183/AdviceByte
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
53 lines (46 loc) · 1.78 KB
/
process.php
File metadata and controls
53 lines (46 loc) · 1.78 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
47
48
49
50
51
52
53
<?php
$servername = "sql109.epizy.com";
$username = "epiz_28239248";
$password = "42cBG9MYx3";
$conn = new mysqli($servername, $username, $password, "epiz_28239248_AdviceByte");
if ($conn->connect_error) {
echo '<script>alert("Connection failed")</script>';
die("Connection failed: " . $conn->connect_error);
}
// require_once('connection.php');
if(isset($conn,$_POST['submit-btn']))
{
$name = mysqli_real_escape_string($conn,$_POST['name']);
$field = mysqli_real_escape_string($conn,$_POST['field']);
// $exp = mysqli_real_escape_string($con,$_POST['exp']);
$mail = mysqli_real_escape_string($conn,$_POST['mail']);
$phone = mysqli_real_escape_string($conn,$_POST['phone']);
$password=htmlspecialchars(stripslashes(trim($_POST['password'])));
$repassword=htmlspecialchars(stripslashes(trim($_POST['repassword'])));
// $gender = mysqli_real_escape_string($con,$_POST['gender']);
// echo $username , $mail , $phone , $gender;
if(empty($name) || empty($mail) || empty($field) || empty($phone) || empty($password) || empty($repassword))
{
echo '<script>alert("Enter the all the fields")</script>';
header("Refresh:0; url=mentorlogin.html");
}
if($password!=$repassword)
{
echo '<script>alert("Confirm password and password should be same")</script>';
header("Refresh:0; url=mentorlogin.html");
}
else{
$sql = "insert into mentor(Name,password,mail,phno,field)values('$name','$password','$mail','$phone','$field')";
$result = mysqli_query($conn,$sql);
if($result)
{
session_start();
$_SESSION['mail'] = $mail;
header('Location:./mentorpage.php');
}
else{
echo($conn->error);
}
}
}
?>