示例#1
0
<?php

session_start();
require '/var/www/maaatch.com/htdocs/common/utility.php';
login_redir("/", false);
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Maaatch&nbsp;&nbsp;|&nbsp;&nbsp;Register</title>
		<?php 
require '/var/www/maaatch.com/htdocs/common/common.php';
?>
		<?php 
head_tags();
?>
		<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
		<script src="rvalidate.js"></script>
	</head>
	<body>
		<?php 
navbar("Sign Up", 0);
?>
		<main class="container">
			<form class="form-signin" action="register.php" method="post">

				<h2 class="form-signin-heading">Register an account</h2>
				
				<label for="inputUser" class="sr-only">Username</label>
				<input name="username" type="text" id="inputUser" class="form-control" placeholder="Username" required autofocus>
				
示例#2
0
<?php

session_start();
require '/var/www/maaatch.com/htdocs/common/utility.php';
require '/var/www/maaatch.com/db_auth.php';
$db = new mysqli($db_host, $db_user, $db_pass, $db_name);
// if user not specified, must be logged in
if (isset($_GET['user']) && ($active_user = $_GET['user'])) {
    $stmt = $db->prepare('SELECT CONCAT_WS(" ", name_first, name_last) AS name FROM users WHERE username = ?;');
    $stmt->bind_param('s', $active_user);
    $stmt->execute();
    $active_name = $stmt->get_result()->fetch_assoc()['name'];
} else {
    login_redir('/login/', true);
    $active_user = $_SESSION['username'];
    $active_name = $_SESSION['name'];
}
$self = !isset($_GET['user']) || !$_GET['user'] || $_GET['user'] == $_SESSION['username'];
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Maaatch&nbsp;&nbsp;|&nbsp;&nbsp;Wishlist</title>
		<?php 
require '/var/www/maaatch.com/htdocs/common/common.php';
?>
		<?php 
head_tags();
?>
		<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
        <script src="wishlist.js"></script>