This repository was archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecQSubmit.php
More file actions
64 lines (57 loc) · 1.64 KB
/
SecQSubmit.php
File metadata and controls
64 lines (57 loc) · 1.64 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
54
55
56
57
58
59
60
61
62
63
64
<?php
require_once('SQLFunctions.php');
include('session.php');
/* Check that question & answer are populated */
if(!isset( $_POST['SecA'], $_POST['SecQ']))
{
$message = 'Please select a question and enter an answer';
}
/* Check answer for alpha numeric characters */
elseif (ctype_alnum($_POST['SecA']) != true)
{
$message = "Answer must be alpha numeric";
}
else
{
//if(isset($_POST['submit'])) {
$link = f_sqlConnect();
$SecQ = $_POST['SecQ'];
$seca = $_POST['SecA'];
$SecA = filter_var($seca, FILTER_SANITIZE_STRING);
$Username = $_SESSION['username'];
if(!isset($Username)) {
$message = "No user logged in";
} else {
$query = "
UPDATE
users_enc
SET
SecQ = '$SecQ'
,SecA = '$SecA'
,updated_By = '$Username'
,LastUpdated = NOW()
WHERE
Username = '$Username'";
mysqli_query($link, $query) or
die("Insert failed. " . mysqli_error($link));
//$message = "<p class='message'>Your security question has been saved</p>";
header('location: dashboard.php');
}
}
mysqli_close($link);
?>
<HTML>
<HEAD>
<TITLE>
SVBX - LOGON
</TITLE>
<link rel="stylesheet" href="styles.css" type="text/css"/>
</HEAD>
<BODY>
<?php
include('filestart.php');
if (!empty($message)) echo $message;
include 'fileend.php';
?>
</BODY>
</HTML>