-
Notifications
You must be signed in to change notification settings - Fork 0
/
insertApplicant.php
31 lines (27 loc) · 1.1 KB
/
insertApplicant.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
<?php
//inserted these values
require_once($_SERVER["DOCUMENT_ROOT"] . '/../Support/configEnglishMFAContest.php');
require_once($_SERVER["DOCUMENT_ROOT"] . '/../Support/basicLib.php');
$userFname = $db->real_escape_string(htmlspecialchars($_POST["userFname"]));
$userLname = $db->real_escape_string(htmlspecialchars($_POST["userLname"]));
$umid = htmlspecialchars($_POST["umid"]);
$uniqname = htmlspecialchars($_POST["uniqname"]);
$classLevel = htmlspecialchars($_POST["classLevel"]);
settype($userFname, "string");
settype($userLname, "string");
settype($umid, "string");
settype($uniqname, "string");
settype($classLevel, "int");
$sqlInsert = <<<SQL
INSERT INTO `tbl_applicant` (`userFname`, `userLname`, `umid`, `uniqname`
,`classLevel`, `created_by`, `created_on`)
VALUES ('$userFname', '$userLname', '$umid', '$uniqname'
, '$classLevel', '$login_name', now())
SQL;
if (!$db->query($sqlInsert)) {
db_fatal_error("Insert failed", $db->error, $sqlInsert, $login_name);
exit($user_err_message);
}
//echo "New record created successfully";
safeRedirect('index.php');
exit();