-
Notifications
You must be signed in to change notification settings - Fork 2
/
mentor_reg.php
49 lines (21 loc) · 1.18 KB
/
mentor_reg.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
<?php
$link = mysqli_connect("localhost","root","","incubation");
if (mysqli_connect_error()){
die("Cannot connect to database. Sorry!");
}
if (array_key_exists("email",$_POST) and (array_key_exists("password",$_POST))){
$query = "select * from `mentors` where `email` ='".mysqli_real_escape_string($link,$_POST["email"])."'";
$result=mysqli_query($link,$query);
if (mysqli_num_rows($result)>0){
echo "This email is alredy registered";
}else{
$query = "insert into `mentors`(`email`,`password`
,`work_experince`,`fsp`,`number`,`name`) values ('".$_POST['email']."','".mysqli_real_escape_string($link,$_POST["password"])."','".mysqli_real_escape_string($link,$_POST["work_experience"])."','".mysqli_real_escape_string($link,$_POST["fsp"])."','".mysqli_real_escape_string($link,$_POST["number"])."','".mysqli_real_escape_string($link,$_POST["name"])."')";//s.mysqli_real_escape_string($link,$_POST["financial"])."','".mysqli_real_escape_string($link,$_POST["manpower"]).
if(mysqli_query($link, $query)){
header("Location: mentorlogin.php");
};
}}
else{
//echo ("There was some error. Please try again later!");
}
?>