You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

535 lines
22 KiB

  1. <?php
  2. // Project: Web Reference Database (refbase) <http://www.refbase.net>
  3. // Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
  4. // original author(s).
  5. //
  6. // This code is distributed in the hope that it will be useful,
  7. // but WITHOUT ANY WARRANTY. Please see the GNU General Public
  8. // License for more details.
  9. //
  10. // File: ./user_details.php
  11. // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/user_details.php $
  12. // Author(s): Matthias Steffens <mailto:refbase@extracts.de>
  13. //
  14. // Created: 16-Apr-02, 10:55
  15. // Modified: $Date: 2017-04-13 02:00:18 +0000 (Thu, 13 Apr 2017) $
  16. // $Author: karnesky $
  17. // $Revision: 1416 $
  18. // This script shows the user a user <form>. It can be used both for INSERTing a new user and for UPDATE-ing an existing user.
  19. // If the user is logged in, then it is an UPDATE; otherwise, an INSERT. The script also shows error messages above widgets that
  20. // contain erroneous data; errors are generated by 'user_validation.php'.
  21. // TODO: I18n
  22. // Incorporate some include files:
  23. include 'initialize/db.inc.php'; // 'db.inc.php' is included to hide username and password
  24. include 'includes/header.inc.php'; // include header
  25. include 'includes/footer.inc.php'; // include footer
  26. include 'includes/include.inc.php'; // include common functions
  27. include 'initialize/ini.inc.php'; // include common variables
  28. // --------------------------------------------------------------------
  29. // START A SESSION:
  30. // call the 'start_session()' function (from 'include.inc.php') which will also read out available session variables:
  31. start_session(true);
  32. // --------------------------------------------------------------------
  33. // Initialize preferred display language:
  34. // (note that 'locales.inc.php' has to be included *after* the call to the 'start_session()' function)
  35. include 'includes/locales.inc.php'; // include the locales
  36. // --------------------------------------------------------------------
  37. // Extract session variables (only necessary if register globals is OFF!):
  38. if (isset($_SESSION['errors']))
  39. $errors = $_SESSION['errors'];
  40. else
  41. $errors = array(); // initialize variable (in order to prevent 'Undefined index/variable...' messages)
  42. if (isset($_SESSION['formVars']))
  43. $formVars = $_SESSION['formVars'];
  44. else
  45. $formVars = array(); // initialize variable (in order to prevent 'Undefined index/variable...' messages)
  46. // The current values of the session variables 'errors' and 'formVars' get stored in '$errors' or '$formVars', respectively. (either automatically if
  47. // register globals is ON, or explicitly if register globals is OFF [by uncommenting the code above]).
  48. // We need to clear these session variables here, since they would otherwise be there even if 'user_details.php' gets called with a different userID!
  49. // Note: though we clear the session variables, the current error message (or form variables) is still available to this script via '$errors' (or '$formVars', respectively).
  50. deleteSessionVariable("errors"); // function 'deleteSessionVariable()' is defined in 'include.inc.php'
  51. deleteSessionVariable("formVars");
  52. // --------------------------------------------------------------------
  53. // (1) OPEN CONNECTION, (2) SELECT DATABASE
  54. connectToMySQLDatabase(); // function 'connectToMySQLDatabase()' is defined in 'include.inc.php'
  55. // --------------------------------------------------------------------
  56. // Set the '$userID' variable:
  57. if (isset($_REQUEST['userID'])) // for normal users NOT being logged in -OR- for the admin:
  58. $userID = $_REQUEST['userID'];
  59. else
  60. $userID = NULL; // '$userID = ""' wouldn't be correct here, since then any later 'isset($userID)' statement would resolve to true!
  61. if (isset($_SESSION['loginEmail']) && ($loginEmail != $adminLoginEmail)) // a normal user IS logged in ('$adminLoginEmail' is specified in 'ini.inc.php')
  62. // Check this user matches the userID (viewing and modifying user account details is only allowed to the admin)
  63. if ($userID != getUserID($loginEmail)) // (function 'getUserID()' is defined in 'include.inc.php')
  64. {
  65. // save an error message:
  66. $HeaderString = "You can only edit your own user data!";
  67. // Write back session variables:
  68. saveSessionVariable("HeaderString", $HeaderString); // function 'saveSessionVariable()' is defined in 'include.inc.php'
  69. $userID = getUserID($loginEmail); // re-establish the user's correct user_id
  70. }
  71. // --------------------------------------------------------------------
  72. // A user must be logged in in order to call 'user_details.php' WITH the 'userID' parameter:
  73. if (!isset($_SESSION['loginEmail']) && ($userID != 0))
  74. {
  75. // save an error message:
  76. $HeaderString = "You must login to view your user account details!";
  77. // save the URL of the currently displayed page:
  78. $referer = $_SERVER['HTTP_REFERER'];
  79. // Write back session variables:
  80. saveSessionVariable("HeaderString", $HeaderString); // function 'saveSessionVariable()' is defined in 'include.inc.php'
  81. saveSessionVariable("referer", $referer);
  82. header("Location: user_login.php");
  83. exit;
  84. }
  85. // --------------------------------------------------------------------
  86. // Check if the logged-in user is allowed to modify his account details:
  87. if (isset($_SESSION['loginEmail']) AND ($userID != 0) AND isset($_SESSION['user_permissions']) AND !preg_match("/allow_modify_options/", $_SESSION['user_permissions'])) // if a user is logged in but the 'user_permissions' session variable does NOT contain 'allow_modify_options'...
  88. {
  89. // save an error message:
  90. $HeaderString = "You have no permission to modify your user account details!";
  91. // Write back session variables:
  92. saveSessionVariable("HeaderString", $HeaderString); // function 'saveSessionVariable()' is defined in 'include.inc.php'
  93. // Redirect the browser back to the main page
  94. header("Location: index.php");
  95. exit;
  96. }
  97. // --------------------------------------------------------------------
  98. // Prepare meaningful instructions for UPDATE or INSERT:
  99. if (!isset($_SESSION['HeaderString'])) // if there's no stored message available
  100. {
  101. if (empty($errors)) // provide one of the default messages:
  102. {
  103. if (isset($_SESSION['loginEmail']) && isset($userID) && !empty($userID)) // -> the user is logged in and views a user entry
  104. $HeaderString = "Please amend your details below as required. Fields shown in bold are mandatory.";
  105. else // -> the user is NOT logged in (OR: the admin is logged in and wants to add a new user, by calling 'user_details.php' w/o any 'userID')
  106. {
  107. if ((!isset($_SESSION['loginEmail']) && ($addNewUsers == "everyone") && ($userID == "")) | (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail) && ($userID == "")))
  108. $HeaderString = "Add a new user. Fields shown in bold are mandatory.";
  109. else // ask a user to submit its user details for approval by the database admin:
  110. $HeaderString = "Please fill in the details below to join. Fields shown in bold are mandatory.";
  111. }
  112. }
  113. else // -> there were errors validating the user's details
  114. $HeaderString = "There were validation errors regarding the details you entered. Please check the comments above the respective fields:";
  115. }
  116. else
  117. {
  118. $HeaderString = $_SESSION['HeaderString']; // extract 'HeaderString' session variable (only necessary if register globals is OFF!)
  119. // Note: though we clear the session variable, the current message is still available to this script via '$HeaderString':
  120. deleteSessionVariable("HeaderString"); // function 'deleteSessionVariable()' is defined in 'include.inc.php'
  121. }
  122. // Extract the view type requested by the user (either 'Mobile', 'Print', 'Web' or ''):
  123. // ('' will produce the default 'Web' output style)
  124. if (isset($_REQUEST['viewType']))
  125. $viewType = $_REQUEST['viewType'];
  126. else
  127. $viewType = "";
  128. // Is the user logged in and were there no errors from a previous validation? If so, look up the user for editing:
  129. if (isset($_SESSION['loginEmail']) && empty($errors) && isset($userID) && !empty($userID))
  130. {
  131. // CONSTRUCT SQL QUERY:
  132. $query = "SELECT * FROM $tableUsers WHERE user_id = " . quote_smart($userID);
  133. // --------------------------------------------------------------------
  134. // (3a) RUN the query on the database through the connection:
  135. $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php'
  136. // (3b) EXTRACT results:
  137. $row = mysqli_fetch_array($result); //fetch the current row into the array $row
  138. // If the admin is logged in AND the displayed user data are NOT his own, we overwrite the default header message:
  139. // (Since the admin is allowed to view and edit account data from other users, we have to provide a dynamic header message in that case)
  140. if (($loginEmail == $adminLoginEmail) && ($userID != getUserID($loginEmail))) // ('$adminLoginEmail' is specified in 'ini.inc.php')
  141. if (!isset($_SESSION['HeaderString']))
  142. $HeaderString = "Edit account details for " . encodeHTML($row["first_name"]) . " " . encodeHTML($row["last_name"]) . " (" . $row["email"] . "):";
  143. }
  144. // Show the login status:
  145. showLogin(); // (function 'showLogin()' is defined in 'include.inc.php')
  146. // (4) DISPLAY header:
  147. // call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'):
  148. displayHTMLhead(encodeHTML($officialDatabaseName) . " -- User Details", "noindex,nofollow", "User details required for use of the " . encodeHTML($officialDatabaseName), "\n\t<meta http-equiv=\"expires\" content=\"0\">", true, "", $viewType, array());
  149. showPageHeader($HeaderString);
  150. // (5) CLOSE the database connection:
  151. disconnectFromMySQLDatabase(); // function 'disconnectFromMySQLDatabase()' is defined in 'include.inc.php'
  152. // --------------------------------------------------------------------
  153. if (isset($_SESSION['loginEmail']) && empty($errors) && isset($userID) && !empty($userID))
  154. {
  155. // Reset the '$formVars' variable (since we're loading from the user table):
  156. $formVars = array();
  157. // Reset the '$errors' variable:
  158. $errors = array();
  159. // Load all the form variables with user data:
  160. $formVars["firstName"] = $row["first_name"];
  161. $formVars["lastName"] = $row["last_name"];
  162. $formVars["title"] = $row["title"];
  163. $formVars["institution"] = $row["institution"];
  164. $formVars["abbrevInstitution"] = $row["abbrev_institution"];
  165. $formVars["corporateInstitution"] = $row["corporate_institution"];
  166. $formVars["address1"] = $row["address_line_1"];
  167. $formVars["address2"] = $row["address_line_2"];
  168. $formVars["address3"] = $row["address_line_3"];
  169. $formVars["zipCode"] = $row["zip_code"];
  170. $formVars["city"] = $row["city"];
  171. $formVars["state"] = $row["state"];
  172. $formVars["country"] = $row["country"];
  173. $formVars["phone"] = $row["phone"];
  174. $formVars["email"] = $row["email"];
  175. $formVars["url"] = $row["url"];
  176. if (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail)) // if the admin is logged in
  177. {
  178. $formVars["keywords"] = $row["keywords"];
  179. $formVars["notes"] = $row["notes"];
  180. $formVars["marked"] = $row["marked"];
  181. }
  182. $formVars["language"] = $row["language"];
  183. }
  184. elseif (empty($errors) && (!isset($userID) OR ($userID == ""))) // no userID specified
  185. {
  186. // Reset the '$formVars' variable:
  187. $formVars = array();
  188. // Reset the '$errors' variable:
  189. $errors = array();
  190. // Set all form variables to "" (in order to prevent 'Undefined variable...' messages):
  191. $formVars["firstName"] = "";
  192. $formVars["lastName"] = "";
  193. $formVars["title"] = "";
  194. $formVars["institution"] = "";
  195. $formVars["abbrevInstitution"] = "";
  196. $formVars["corporateInstitution"] = "";
  197. $formVars["address1"] = "";
  198. $formVars["address2"] = "";
  199. $formVars["address3"] = "";
  200. $formVars["zipCode"] = "";
  201. $formVars["city"] = "";
  202. $formVars["state"] = "";
  203. $formVars["country"] = "";
  204. $formVars["phone"] = "";
  205. $formVars["email"] = "";
  206. $formVars["url"] = "";
  207. if (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail)) // if the admin is logged in
  208. {
  209. $formVars["keywords"] = "";
  210. $formVars["notes"] = "";
  211. $formVars["marked"] = "no";
  212. }
  213. $formVars["language"] = "en";
  214. }
  215. // Start <form> and <table> holding all the form elements:
  216. ?>
  217. <form method="POST" action="user_validation.php">
  218. <input type="hidden" name="userID" value="<?php echo encodeHTML($userID) ?>">
  219. <input type="hidden" name="email" value="<?php echo encodeHTML($formVars["email"]) ?>">
  220. <table id="requiredFields" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds form elements with user details">
  221. <tr>
  222. <td align="left" width="169"><b><?php echo $loc["FirstName"]; ?>:</b></td>
  223. <td><?php echo fieldError("firstName", $errors); ?>
  224. <input type="text" name="firstName" value="<?php echo encodeHTML($formVars["firstName"]); ?>" size="50">
  225. </td>
  226. </tr>
  227. <tr>
  228. <td align="left"><b><?php echo $loc["LastName"]; ?>:</b></td>
  229. <td><?php echo fieldError("lastName", $errors); ?>
  230. <input type="text" name="lastName" value="<?php echo encodeHTML($formVars["lastName"]); ?>" size="50">
  231. </td>
  232. </tr>
  233. <?php
  234. // Only show the username/email and password widgets to new users (or the admin, since he's allowed to call 'user_details.php' w/o any 'userID' when logged in):
  235. if (!isset($_SESSION['loginEmail']) | (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail) && ($userID == "")))
  236. {
  237. ?>
  238. <tr>
  239. <td align="left"><b><?php echo $loc["Email"]; ?>:</b></td>
  240. <td><?php echo fieldError("email", $errors); ?>
  241. <input type="text" name="email" value="<?php echo encodeHTML($formVars["email"]); ?>" size="30">
  242. </td>
  243. </tr>
  244. <tr>
  245. <td align="left"><b><?php echo $loc["Password"]; ?>:</b></td>
  246. <td><?php echo fieldError("loginPassword", $errors); ?>
  247. <input type="password" name="loginPassword" value="" size="30">
  248. </td>
  249. </tr>
  250. <tr>
  251. <td align="left"><b><?php echo $loc["VerifyPassword"]; ?>:</b></td>
  252. <td><?php echo fieldError("loginPasswordRetyped", $errors); ?>
  253. <input type="password" name="loginPasswordRetyped" value="" size="30">
  254. </td>
  255. </tr>
  256. <?php
  257. }
  258. // if a user is logged in, we also show the password field (but with a different label text) so that the user is able to change his password later on:
  259. // (just keep the password field empty, if you don't want to change your password)
  260. elseif (isset($_SESSION['loginEmail']) && isset($userID))
  261. {
  262. ?>
  263. <tr>
  264. <td align="left"><?php echo $loc["NewPassword"]; ?>:</td>
  265. <td><?php echo fieldError("loginPassword", $errors); ?>
  266. <input type="password" name="loginPassword" value="" size="30">
  267. </td>
  268. </tr>
  269. <tr>
  270. <td align="left"><?php echo $loc["VerifyNewPassword"]; ?>:</td>
  271. <td><?php echo fieldError("loginPasswordRetyped", $errors); ?>
  272. <input type="password" name="loginPasswordRetyped" value="" size="30">
  273. </td>
  274. </tr>
  275. <?php
  276. }
  277. ?>
  278. <tr>
  279. <td align="left"><b><?php echo $loc["InstitutionAbbr"]; ?>:</b></td>
  280. <td><?php echo fieldError("abbrevInstitution", $errors); ?>
  281. <input type="text" name="abbrevInstitution" value="<?php echo encodeHTML($formVars["abbrevInstitution"]); ?>" size="12">
  282. </td>
  283. </tr>
  284. <tr>
  285. <td align="left"></td>
  286. <td>
  287. <?php
  288. // The submit button reads 'Add' if an authorized user uses 'user_details.php' to add a new user (-> 'userID' is empty!)
  289. // This should make it more clear that submitting the form is going to add a new user without any further approval!
  290. // INSERTs are allowed to:
  291. // 1. EVERYONE who's not logged in (but ONLY if variable '$addNewUsers' in 'ini.inc.php' is set to "everyone"!)
  292. // (Note that this feature is actually only meant to add the very first user to the users table.
  293. // After you've done so, it is highly recommended to change the value of '$addNewUsers' to 'admin'!)
  294. // -or- 2. the ADMIN only (if variable '$addNewUsers' in 'ini.inc.php' is set to "admin")
  295. if ((!isset($_SESSION['loginEmail']) && ($addNewUsers == "everyone") && ($userID == "")) | (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail) && ($userID == "")))
  296. {
  297. ?>
  298. <input type="submit" value="Add User">
  299. <?php
  300. }
  301. else // ...otherwise the submit button reads (guess what) 'Submit' (i.e., solely an email will be sent to the admin for further approval):
  302. {
  303. ?>
  304. <input type="submit" value="Submit">
  305. <?php
  306. }
  307. ?>
  308. </td>
  309. </tr>
  310. </table>
  311. <table class="showhide" align="center" border="0" cellpadding="0" cellspacing="10" width="95%">
  312. <tr>
  313. <td class="small" width="120" valign="top">
  314. <a href="javascript:toggleVisibility('optionalFields','optToggleimg','optToggletxt','<?php echo rawurlencode($loc["OptionalFields"]); ?>')"<?php echo addAccessKey("attribute", "search_opt"); ?> title="<?php echo $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "search_opt"); ?>">
  315. <img id="optToggleimg" class="toggleimg" src="img/closed.gif" alt="<?php echo $loc["LinkTitle_ToggleVisibility"]; ?>" width="9" height="9" hspace="0" border="0">
  316. <span id="optToggletxt" class="toggletxt"><?php echo $loc["OptionalFields"]; ?></span>
  317. </a>
  318. </td>
  319. </tr>
  320. </table>
  321. <table id="optionalFields" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds form elements with user details" style="display: none;">
  322. <tr>
  323. <td align="left" width="169"><?php echo $loc["Title"]; ?>:</td>
  324. <td>
  325. <select name="title">
  326. <option <?php if ($formVars["title"]=="Mr") echo "selected"; ?>>Mr</option>
  327. <option <?php if ($formVars["title"]=="Mrs") echo "selected"; ?>>Mrs</option>
  328. <option <?php if ($formVars["title"]=="Ms") echo "selected"; ?>>Ms</option>
  329. <option <?php if ($formVars["title"]=="Dr") echo "selected"; ?>>Dr</option>
  330. </select>
  331. <br>
  332. </td>
  333. </tr>
  334. <tr>
  335. <td align="left"><?php echo $loc["Institution"]; ?>:</td>
  336. <td><?php echo fieldError("institution", $errors); ?>
  337. <input type="text" name="institution" value="<?php echo encodeHTML($formVars["institution"]); ?>" size="50">
  338. </td>
  339. </tr>
  340. <tr>
  341. <td align="left"><?php echo $loc["CorporateInstitution"]; ?>:</td>
  342. <td><?php echo fieldError("corporateInstitution", $errors); ?>
  343. <input type="text" name="corporateInstitution" value="<?php echo encodeHTML($formVars["corporateInstitution"]); ?>" size="50">
  344. </td>
  345. </tr>
  346. <tr>
  347. <td align="left"><?php echo $loc["WorkAddress"]; ?>:</td>
  348. <td><?php echo fieldError("address1", $errors); ?>
  349. <input type="text" name="address1" value="<?php echo encodeHTML($formVars["address1"]); ?>" size="50">
  350. </td>
  351. </tr>
  352. <tr>
  353. <td align="left"></td>
  354. <td><?php echo fieldError("address2", $errors); ?>
  355. <input type="text" name="address2" value="<?php echo encodeHTML($formVars["address2"]); ?>" size="50">
  356. </td>
  357. </tr>
  358. <tr>
  359. <td align="left"></td>
  360. <td><?php echo fieldError("address3", $errors); ?>
  361. <input type="text" name="address3" value="<?php echo encodeHTML($formVars["address3"]); ?>" size="50">
  362. </td>
  363. </tr>
  364. <tr>
  365. <td align="left"><?php echo $loc["ZipCode"]; ?>:</td>
  366. <td><?php echo fieldError("zipCode", $errors); ?>
  367. <input type="text" name="zipCode" value="<?php echo encodeHTML($formVars["zipCode"]); ?>" size="12">
  368. </td>
  369. </tr>
  370. <tr>
  371. <td align="left"><?php echo $loc["City"]; ?>:</td>
  372. <td><?php echo fieldError("city", $errors); ?>
  373. <input type="text" name="city" value="<?php echo encodeHTML($formVars["city"]); ?>" size="50">
  374. </td>
  375. </tr>
  376. <tr>
  377. <td align="left"><?php echo $loc["State"]; ?>:</td>
  378. <td><?php echo fieldError("state", $errors); ?>
  379. <input type="text" name="state" value="<?php echo encodeHTML($formVars["state"]); ?>" size="50">
  380. </td>
  381. </tr>
  382. <tr>
  383. <td align="left"><?php echo $loc["Country"]; ?>:</td>
  384. <td><?php echo fieldError("country", $errors); ?>
  385. <input type="text" name="country" value="<?php echo encodeHTML($formVars["country"]); ?>" size="50">
  386. </td>
  387. </tr>
  388. <tr>
  389. <td align="left"><?php echo $loc["Phone"]; ?>:</td>
  390. <td><?php echo fieldError("phone", $errors); ?>
  391. <input type="text" name="phone" value="<?php echo encodeHTML($formVars["phone"]); ?>" size="50">
  392. </td>
  393. </tr>
  394. <tr>
  395. <td align="left"><?php echo $loc["URL"]; ?>:</td>
  396. <td><?php echo fieldError("url", $errors); ?>
  397. <input type="text" name="url" value="<?php echo encodeHTML($formVars["url"]); ?>" size="50">
  398. </td>
  399. </tr>
  400. <?php
  401. // if the admin is logged in, we'll show additional fields:
  402. if (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail))
  403. {
  404. if ($formVars["marked"] == "yes")
  405. {
  406. $markedRadioYesChecked = "checked";
  407. $markedRadioNoChecked = "";
  408. }
  409. else // $formVars["marked"] == "no"
  410. {
  411. $markedRadioYesChecked = "";
  412. $markedRadioNoChecked = "checked";
  413. }
  414. ?>
  415. <tr>
  416. <td align="left"><?php echo $loc["Keywords"]; ?>:</td>
  417. <td><?php echo fieldError("keywords", $errors); ?>
  418. <input type="text" name="keywords" value="<?php echo encodeHTML($formVars["keywords"]); ?>" size="50">
  419. </td>
  420. </tr>
  421. <tr>
  422. <td align="left"><?php echo $loc["Notes"]; ?>:</td>
  423. <td><?php echo fieldError("notes", $errors); ?>
  424. <input type="text" name="notes" value="<?php echo encodeHTML($formVars["notes"]); ?>" size="50">
  425. </td>
  426. </tr>
  427. <tr>
  428. <td align="left"><?php echo $loc["Marked"]; ?>:</td>
  429. <td><?php echo fieldError("marked", $errors); ?>
  430. <input type="radio" name="marked" value="yes"<?php echo $markedRadioYesChecked; ?>>&nbsp;&nbsp;<?php echo $loc["yes"]; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="marked" value="no"<?php echo $markedRadioNoChecked; ?>>&nbsp;&nbsp;<?php echo $loc["no"]; ?>
  431. </td>
  432. </tr>
  433. <?php
  434. }
  435. ?>
  436. </table>
  437. </form><?php
  438. // --------------------------------------------------------------------
  439. // SHOW ERROR IN RED:
  440. function fieldError($fieldName, $errors)
  441. {
  442. if (isset($errors[$fieldName]))
  443. echo "\n\t\t<b><span class=\"warning\">" . $errors[$fieldName] . "</span></b>\n\t\t<br>";
  444. }
  445. // --------------------------------------------------------------------
  446. // DISPLAY THE HTML FOOTER:
  447. // call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php')
  448. showPageFooter($HeaderString);
  449. displayHTMLfoot();
  450. // --------------------------------------------------------------------
  451. ?>