';
+}
+$stmtview->close();
+echo 'Return to title manager';
+?>
\ No newline at end of file
diff --git a/includes/title-update.php b/includes/title-update.php
new file mode 100644
index 0000000..4773de2
--- /dev/null
+++ b/includes/title-update.php
@@ -0,0 +1,26 @@
+Please check the box to verify you want to delete: ' . $_POST['titlename'] . ' ';
+ echo '
';
+ } else if ($_POST['deltitle'] == "iamsure") {
+ // this section actually deletes the title
+ $stmtdel = $con->prepare("DELETE FROM gwtitles WHERE titlenameid = ?");
+ $stmtdel->bind_param("i", $_POST['titlenameid']);
+ $stmtdel->execute();
+ $stmtdel->close();
+ echo 'Title has been deleted, redirecting!';
+ header ("Refresh:1; url=titlemanager.php");
+ }
+} else {
+ // this section updates the title name
+ $stmtupd = $con->prepare("UPDATE gwtitles SET titlename = ?, titletype = ? WHERE titlenameid = ?");
+ $stmtupd->bind_param("sii", $_POST['titlename'], $_POST['titletype'], $_POST['titlenameid']);
+ $stmtupd->execute();
+ $stmtupd->close();
+ echo 'Title updated, redirecting!';
+ header ("Refresh:1; url=titlemanager.php");
+}
+//echo 'Return to title manager'; //this line needs to go away soon
+?>
\ No newline at end of file
diff --git a/includes/verifications.php b/includes/verifications.php
new file mode 100644
index 0000000..24f4d06
--- /dev/null
+++ b/includes/verifications.php
@@ -0,0 +1,55 @@
+= 1) {
+ echo '
This e-mail address is already registered, please click on the forgot password link. Please try again! ';
+ include_once ('footer.php');
+ exit();
+ }
+}
+
+# this function verifies that a username doesn't already exist in the database
+function validateUsername($uname) {
+ $con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
+ $sqlunamecheck = "SELECT username FROM userinfo WHERE userinfo.username = '" . $uname . "'";
+ $results = mysqli_query($con, $sqlunamecheck);
+ if (mysqli_num_rows($results) >= 1) {
+ echo '
This username has already been taken, please choose another one Please try again! ';
+ include_once ('footer.php');
+ exit();
+ }
+}
+
+####################
+# verifying the username doesn't already exist in the database
+$username = mysqli_real_escape_string($con, $_POST['username']);
+validateUsername($username);
+
+####################
+# verifying the e-mail address is in a valid format
+$verifyemail = validateEmail($_POST['useremail']);
+if (empty($verifyemail)) {
+ echo '
This address: ' . $_POST['useremail'] . ' is not a valid e-mail address! Please verify and type it again. ';
+ include_once ('footer.php');
+ exit();
+}
+
+usedEmail($_POST['useremail']);
+
+####################
+# verifying passwords match each other
+
+if (($_POST['userpass1']) != ($_POST['userpass2'])) {
+ echo '
The passwords don\'t match! Please try again!';
+ include_once ('footer.php');
+ exit();
+}
+?>
\ No newline at end of file