-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestmeet2.php
More file actions
44 lines (37 loc) · 1.17 KB
/
Copy pathrequestmeet2.php
File metadata and controls
44 lines (37 loc) · 1.17 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
<?php
require "dbconn.php";
session_start();
if(!$_SESSION["email"]){
header("location:index.php");
}
$usermail=$_SESSION["email"];
if(isset($_POST['request-submit']))
{
if($_POST['email']=='')
{
echo "<script>alert('Enter email');document.location='learner_index.php'</script>";
exit();
}
$result =mysqli_query($con,"SELECT to_user FROM request WHERE `to_user` = '".$_POST['email']."'");
if ($result && mysqli_num_rows($result) > 0)
{
echo "<script>alert('Request Already Exits');document.location='learner_index.php'</script>";
exit();
}
$result =mysqli_query($con,"SELECT email FROM teach_register WHERE `email` = '".$_POST['email']."'");
if ($result && mysqli_num_rows($result) > 0)
{
$get=mysqli_query($con,"select * from request order by sno desc limit 1");
$got=mysqli_fetch_array($get);
$did=$got['sno'];
$id=$did;
$id++;
$eml=$_SESSION['email'];
$postemail=$_POST['email'];
mysqli_query($con,"insert into request
values('$id','$eml','$postemail');")
or die(mysqli_error($con));
}
echo "<script>alert('Request successfully registered');document.location='learner_index.php'</script>";
exit();
}