fix: Update HTML Structure of Login Screen#54
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the login.php page markup to use more semantic HTML (main/section/fieldset/label), improve accessibility attributes, and simplify the login form structure.
Changes:
- Replaces the legacy table-based layout with semantic form markup (
<main>,<fieldset>,<label>). - Adds basic accessibility improvements (labels,
aria-live,aria-describedby) and client-side required fields. - Refactors the focus-on-load script to target the new form name.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -14,135 +14,59 @@ | |||
| $sselected = 1; $subtitle = $_i18n["login.submenu"]; $selected = $_GET[ "sm" ]; | |||
| $items = array( $_i18n["login.submenu"], $_i18n["register.submenu"] ); $links = array( "./login.php", "./register.php" ); | |||
| include("includes/header.php"); | |||
There was a problem hiding this comment.
After include("includes/header.php"); the script remains in PHP mode, but the next line outputs raw HTML (<main ...>). This will cause a PHP parse error unless you close PHP (?>) or echo/print the HTML.
| include("includes/header.php"); | |
| include("includes/header.php"); | |
| ?> |
| <br> | ||
| <?php } ?> | ||
| </section> | ||
| <?php $fields = " " . base64_decode( $_GET[ "tk" ] );?> |
There was a problem hiding this comment.
base64_decode($_GET["tk"]) is called without checking that tk exists. On newer PHP versions, passing null to base64_decode() can raise a TypeError. Consider defaulting to an empty string when tk is missing (and only decoding when it is present).
| <?php $fields = " " . base64_decode( $_GET[ "tk" ] );?> | |
| <?php $fields = " " . ( isset( $_GET[ "tk" ] ) ? base64_decode( $_GET[ "tk" ] ) : "" );?> |
| focusControl.focus(); | ||
| } | ||
| }; | ||
| </script> |
There was a problem hiding this comment.
The page no longer includes ./includes/foot.php and also ends with </html> without closing </body>. Since includes/header.php opens the <body> tag, this leaves the document structure incomplete and will also drop the footer/scripts from includes/foot.php. Restore the footer include and ensure </body></html> are properly closed.
| </script> | |
| </script> | |
| <?php include("./includes/foot.php"); ?> | |
| </body> |
Automated fix by CoderOps.
Swarm: sw5
Task: Update HTML Structure of Login Screen