-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudentQuestion.inc.php
34 lines (32 loc) · 1.16 KB
/
studentQuestion.inc.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
<?php
session_start();
require_once 'dbh.inc.php';
if (isset($_POST["submit"])) {
if (isset($_SESSION['useruid'])) {
$studentUid = $_SESSION['useruid'];
$sql = "SELECT userId FROM users WHERE userUid='$studentUid'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$userId = $row['userId'];
$query = "SELECT * FROM student WHERE studentUid='$studentUid'";
$run = mysqli_query($conn, $query);
if (mysqli_num_rows($run) > 0) {
$teacherUid = $_GET['teacherUid'];
$videoId = $_POST['videoId'];
$videoTitle = $_POST['videoTitle'];
$serviceTitle = $_GET['servicesTitle'];
$message = $_POST['message'];
require_once 'studentQuestionsFunction.inc.php';
sendMessages($conn, $teacherUid, $studentUid, $videoTitle, $message, $serviceTitle, $videoId);
} else {
header("location: ../sign in.php");
exit();
}
} else {
header("location: ../sign in.php");
exit();
}
} else {
header("location: ../videos.php");
exit();
}