示例#1
0
<h1>Change Password:</h1>

<?php 
if (isset($_GET['success']) && empty($_GET['success'])) {
    echo 'Your password has been changed.<br>You will need to login again with the new password.';
    session_destroy();
    header("refresh:2;url=index.php");
    exit;
} else {
    if (empty($_POST) === false && empty($errors) === true) {
        //Posted the form without errors
        if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') {
            user_change_password($session_user_id, $_POST['new_password']);
        } else {
            if ($config['TFSVersion'] == 'TFS_03') {
                user_change_password03($session_user_id, $_POST['new_password']);
            }
        }
        header('Location: changepassword.php?success');
    } else {
        if (empty($errors) === false) {
            echo '<font color="red"><b>';
            echo output_errors($errors);
            echo '</b></font>';
        }
    }
    ?>

	<form action="" method="post">
		<ul>
			<li>
示例#2
0
文件: admin.php 项目: peonso/ZnoteAAC
         $errors[] = 'Character ' . $_POST['del_name'] . ' permanently deleted.';
     } else {
         $errors[] = 'Character ' . $_POST['del_name'] . ' does not exist.';
     }
 }
 // Reset password for char name
 if (empty($_POST['reset_pass']) === false && empty($_POST['new_pass']) === false) {
     // reset_pass = character name
     if (user_character_exist($_POST['reset_pass'])) {
         $acc_id = user_character_account_id($_POST['reset_pass']);
         if ($acc_id != $session_user_id) {
             if ($config['TFSVersion'] == 'TFS_02') {
                 user_change_password($acc_id, $_POST['new_pass']);
             } else {
                 if ($config['TFSVersion'] == 'TFS_03') {
                     user_change_password03($acc_id, $_POST['new_pass']);
                 }
             }
             $errors[] = 'The password to the account of character name: ' . $_POST['reset_pass'] . ' has been set to: ' . $_POST['new_pass'] . '.';
         } else {
             header('Location: changepassword.php');
             exit;
         }
     }
 }
 // Give points to character
 if (empty($_POST['points_char']) === false && empty($_POST['points_value']) === false) {
     $char = sanitize($_POST['points_char']);
     $points = (int) $_POST['points_value'];
     data_dump($_POST, false, "post data");
     $account = mysql_select_single("SELECT `account_id` FROM `players` WHERE `name`='{$char}' LIMIT 1;");