Fix registration and update register form to new render

This commit is contained in:
Sky Johnson 2024-12-13 22:21:11 -06:00
parent c2e15d580a
commit bf0b05064a
2 changed files with 21 additions and 16 deletions

View File

@ -108,7 +108,7 @@ function register()
$controlrow["verifytext"] = "";
}
$page = parsetemplate(gettemplate("register"), $controlrow);
$page = render('register', ['controlrow' => $controlrow]);
}
display($page, "Register", false, false, false);

View File

@ -1,16 +1,21 @@
<?php
$template = <<<THEVERYENDOFYOU
<form action="users.php?do=register" method="post">
<table width="80%">
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /><br>Usernames must be 30 alphanumeric characters or less.<br><br><br></td></tr>
<tr><td>Password:</td><td><input type="password" name="password1" size="30" maxlength="10" /></td></tr>
<tr><td>Verify Password:</td><td><input type="password" name="password2" size="30" maxlength="10" /><br>Passwords must be 10 alphanumeric characters or less.<br><br><br></td></tr>
<tr><td>Email Address:</td><td><input type="text" name="email1" size="30" maxlength="100" /></td></tr>
<tr><td>Verify Email:</td><td><input type="text" name="email2" size="30" maxlength="100" />{{verifytext}}<br><br><br></td></tr>
<tr><td>Character Class:</td><td><select name="charclass"><option value="1">{{class1name}}</option><option value="2">{{class2name}}</option><option value="3">{{class3name}}</option></select></td></tr>
<tr><td colspan="2">See <a href="/help">Help</a> for more information about character classes.<br><br></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
</table>
<form action="/register" method="post">
<table width="80%">
<tr><td width="20%">Username:</td><td><input type="text" name="username"><br>Usernames must be 30 alphanumeric characters or less.<br><br><br></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"></td></tr>
<tr><td>Verify Password:</td><td><input type="password" name="confirm_password"><br>Passwords must be 10 alphanumeric characters or less.<br><br><br></td></tr>
<tr><td>Email Address:</td><td><input type="email" name="email"></td></tr>
<tr><td>Verify Email:</td><td><input type="email" name="confirm_email"><?= $controlrow['verifytext'] ?><br><br><br></td></tr>
<tr>
<td>Character Class:</td>
<td>
<select name="charclass">
<option value="1"><?= $controlrow['class1name'] ?></option>
<option value="2"><?= $controlrow['class2name'] ?></option>
<option value="3"><?= $controlrow['class3name'] ?></option>
</select>
</td>
</tr>
<tr><td colspan="2">See <a href="/help">Help</a> for more information about character classes.<br><br></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
</table>
</form>
THEVERYENDOFYOU;
?>