示例#1
0
function display_login()
{
    nav_start_outer("Login");
    ?>
<div id="login" class="centerpiece">
<form name=loginform method=POST action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
">
<table>
<tr>
   <td>Username:</td>
  <td><input type=text name=login_username size=30 autocomplete=no value=<?php 
    echo htmlspecialchars($_POST['login_username']);
    ?>
></td>
</tr>
<tr>
   <td>Password:</td>
  <td colspan=2><input type=password name=login_password size=30 autocomplete=no>
  <input type=submit name=submit_login value="Log in">
  <input type=submit name=submit_registration value="Register"></td>
</tr>
</table>
</form>
</div>
<div class="footer warning">
<?php 
    global $login_error;
    echo $login_error;
    ?>
</div>
<script>document.loginform.login_username.focus();</script>
<?php 
    nav_end_outer();
}
示例#2
0
echo $balance > 0 ? $balance : 0;
?>
 zoobars<br/>
<b>Your profile:</b>
<form method="POST" name=profile_form
  action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
<textarea name="profileupdate">
<?php 
if ($_POST['profilesubmit']) {
    // Check for profile submission
    $profile = $_POST['profileupdate'];
    if ($user->id != "*") {
        $sql = "UPDATE Person SET Profile='{$profile}' " . "WHERE PersonID={$user->id}";
        $db->executeQuery($sql);
        // Overwrite profile in database
    }
}
$sql = "SELECT Profile FROM Person WHERE PersonID={$user->id}";
$rs = $db->executeQuery($sql);
echo $rs->getValueByNr(0, 0);
// Output the current profile
?>
</textarea><br/>
<input type=submit name="profilesubmit" value="Save"></form>
<?php 
nav_end_inner();
nav_end_outer();
示例#3
0
function display_login()
{
    nav_start_outer("Login", "");
    $login_username = sanatize_username($_POST['login_username']);
    $php_self = $_SERVER['PHP_SELF'];
    ?>
<div id="login" class="centerpiece">
<form name="loginform" method="POST" action="<?php 
    echo $php_self;
    ?>
">
<table>
<tr>
   <td>Username:</td>
  <td><input type="text" name="login_username" size="30" autocomplete="no" value="<?php 
    echo $login_username;
    ?>
"></td>
</tr>
<tr>
   <td>Password:</td>
  <td colspan="2"><input type="password" name="login_password" size="30" autocomplete="no">
  <input type="submit" name="submit_login" value="Log in">
  <input type="submit" name="submit_registration" value="Register"></td>
</tr>
</table>
</form>
</div>
<div class="footer warning">
<?php 
    global $login_error;
    echo $login_error;
    ?>
</div>
<script>document.loginform.login_username.focus();</script>
<?php 
    nav_end_outer();
}