コード例 #1
0
ファイル: logout.php プロジェクト: jsvhqr/JSC
<?php

require 'DatabaseInteraction.php';
$dbi = new DatabaseInteraction();
$dbi->logout();
$url = 'http://localhost/CalcioForums/index.php';
header("Location:{$url}");
コード例 #2
0
ファイル: register.php プロジェクト: jsvhqr/JSNWeb
<?php

require_once 'DatabaseInteraction.php';
$post_username = $_POST['username'];
$post_password = $_POST['password'];
$post_email = $_POST['email'];
$dbi = new DatabaseInteraction();
$result = $dbi->registerUser($post_username, $post_password, $post_email);
if (!$result) {
    echo 'user exists..';
} else {
    $url = 'http://localhost/JSNWeb/index.php';
    header("Location:{$url}");
}
コード例 #3
0
ファイル: checkEmail.php プロジェクト: jsvhqr/JSC
<?php

require_once 'DatabaseInteraction.php';
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
echo '<response>';
echo '<msg>';
$email = $_GET['email'];
$fail = 'false';
if ($email != null) {
    $dbi = new DatabaseInteraction();
    if ($dbi->emailExists($email)) {
        echo "{$email} already registered";
        $fail = 'true';
    } else {
        echo "ok";
    }
} else {
    echo "email was null..";
}
echo '</msg>';
echo '<fail>';
echo "{$fail}";
echo '</fail>';
echo '</response>';
コード例 #4
0
ファイル: login.php プロジェクト: jsvhqr/JSC
<?php

require_once 'DatabaseInteraction.php';
$post_username = $_POST['username'];
$post_password = $_POST['password'];
$dbi = new DatabaseInteraction();
if ($dbi->login($post_username, $post_password)) {
    $url = 'http://localhost/CalcioForums/index.php';
    header("Location:{$url}");
} else {
    echo 'invalid login';
}
コード例 #5
0
ファイル: checkUsername.php プロジェクト: jsvhqr/JSC
<?php

require_once 'DatabaseInteraction.php';
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
echo '<response>';
echo '<msg>';
$username = $_GET['username'];
$fail = 'false';
if ($username != null) {
    $dbi = new DatabaseInteraction();
    if ($dbi->userExists($username)) {
        echo "{$username} exists";
        $fail = 'true';
    } else {
        echo "{$username} available";
    }
} else {
    echo "username was null..";
}
echo '</msg>';
echo '<fail>';
echo "{$fail}";
echo '</fail>';
echo '</response>';