Example #1
0
				<td><input type="password" name="psw2" required/></td>
			</tr>
			<tr>
				<td>e-mail:</td>
				<td><input type="email" name="email" required/></td>
			</tr>
			<tr>
				<td><input type="submit" name="register_sub" value="register"></td>
			</tr>
		</table>
	</form>
</body>
</html>
<?php 
if (isset($_POST['Un']) && isset($_POST['psw']) && isset($_POST['psw2']) && isset($_POST['email'])) {
    $dbh = useDatabase();
    $name = $_POST['Un'];
    $pass = $_POST['psw'];
    $rpass = $_POST['psw2'];
    $email = $_POST['email'];
    if ($pass != $rpass) {
        exit("password not same");
        //password not same
    }
    $check1 = $dbh->prepare('SELECT * FROM user where name=?');
    //check the same username
    $check1->execute(array($name));
    if (!empty($check1->fetchAll())) {
        exit("name exist");
    }
    $check2 = $dbh->prepare('SELECT * FROM user where email=?');
Example #2
0
<?php

/***** INITIALIZE SESSION *****/
if (!session_id()) {
    session_start();
    $session = session_id();
}
header("Cache-control: private");
// Load the configuration settings
require "../config.settings.php";
require "../library/db.php";
// Activate the database
useDatabase($database_username, $database_password, $database_host, $database_name);
require "../library/commonfunctions.php";
/* The settings, inputs, and users are used by all parts of the system */
$setting = new Setting();
$input = new Input();
$user = new User();
$user->loadSession();
$hideheader = $_REQUEST['hideheader'];
?>
<html>
  <head>
    <meta http-equiv="Content-Language" content="en-us">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="css/sipen.css">
    <?php 
include "includes/javascript.php";
?>
  </head>