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.

537 lines
22 KiB

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