topical media & game development
professional-sql-01-public-files-main.php / php
<?php
// include shared code
include '../lib/common.php';
include '../lib/db.php';
include '../lib/functions.php';
include '../lib/User.php';
// 401 file referenced since user should be logged in to view this page
//include '401.php';
// generate user information form
_SERVER['PHP_SELF']); ?>"
method="post">
<table>
<tr>
<td><label>Username</label></td>
<td><input type="text" name="username" disabled="disabled"
readonly="readonly"value="<?php echo _POST['email']))? htmlspecialchars(
user->emailAddr; ?>"/></td>
</tr><tr>
<td><label for="password">New Password</label></td>
<td><input type="password" name="password1" id="password1"/></td>
</tr><tr>
<td><label for="password2">Password Again</label></td>
<td><input type="password" name="password2" id="password2"/></td>
</tr><tr>
<td> </td>
<td><input type="submit" value="Save"/></td>
<td><input type="hidden" name="submitted" value="1"/></td>
</tr><tr>
</table>
</form>
<?php
GLOBALS['TEMPLATE']['content'] = _POST['submitted']))
{
form;
}
// otherwise process incoming data
else
{
// validate password
_POST['password1']) && _POST['password1']) : password2 = (isset(_POST['password2']) ?
sha1(user->password;
password1 == password1 : '';
// update the record if the input validates
if (User::validateEmailAddr(password)
{
_POST['email'];
password;
GLOBALS['TEMPLATE']['content'] = '<p><strong>Information ' .
'in your record has been updated.</strong></p>';
}
// there was invalid data
else
{
GLOBALS['TEMPLATE']['content'] .=
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.