<?php require 'DatabaseInteraction.php'; $dbi = new DatabaseInteraction(); $dbi->logout(); $url = 'http://localhost/CalcioForums/index.php'; header("Location:{$url}");
<?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}"); }
<?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>';
<?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'; }
<?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>';