-
Notifications
You must be signed in to change notification settings - Fork 2
/
managewordsemanticfield.php
37 lines (34 loc) · 1.33 KB
/
managewordsemanticfield.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
<?php
session_start();
//Page for Managing A Word's See Also Words
require_once ('formdisplayhelperfunctions.php');
$link = connectToDB();
echo "<h1>Manage Semantic Field list fot a Word</h1>";
require_once ('titletop.php');
require_once ('navheaderside.php');
echo "<div class=\"Content\">";
$semanticFields = array_flip(getExistingSemanticFields());
$wordSemanticFields = getWordSemanticFields($_REQUEST['wordID']);
//###########################MAIN LOGIC###################
if ($_POST['_submit_check']){
//We now validate server-side that the submission is correct before processing; if it is not, we show the user the form again with an error message
if(true){
//process the submitted data
process_manageWordSemanticField_form();
$wordSemanticFields = getWordSemanticFields($_REQUEST['wordID']);
show_manageWordSemanticField_form($wordSemanticFields);
}
else{
$_POST['_submit_check'] = 0;
$errorMessage = "A problem has occurred due to the data in your submission. Please recheck and resubmit.";
show_manageWordSemanticField_form($wordSemanticFields);
}
}
else{
// The form wasn't submitted, so display
show_manageWordSemanticField_form($wordSemanticFields);
}
//###################################END MAIN LOGIC####################################
echo "</div>";
require_once('footer.php');
?>