Example #1
0
    header("Location: login.php");
    exit;
}
// If the user is logged in, we can safely proceed.
$userId = $_GET["userId"];
$user = $SimpleUsers->getSingleUser($userId);
if (!$user) {
    die("The user could not be found...");
}
// Validation of input
if (isset($_POST["password"])) {
    if (empty($_POST["password"])) {
        $error = "You have to choose a password";
    } else {
        // Input validation is ok, set the password and then redirect
        $SimpleUsers->setPassword($_POST["password"], $user["userId"]);
        header("Location: users.php");
        exit;
    }
}
// Validation end
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title></title>
	  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	  <style type="text/css">

			* {	margin: 0px; padding: 0px; }
			body