コード例 #1
0
ファイル: account.php プロジェクト: jonvidal/IT202
session_start();
if (isset($_POST['addteam']) && isset($_SESSION['username'])) {
    require_once 'logindb.php.inc';
    $login = new localDB("connect.ini");
    $result = $login->addplayer($_POST['addteam'], $_SESSION['username']);
}
if (isset($_POST['removeplayer']) && isset($_SESSION['username'])) {
    require_once 'logindb.php.inc';
    $login = new localDB("connect.ini");
    $result = $login->removeplayer($_POST['removeplayer'], $_SESSION['username']);
}
if (isset($_SESSION['username'])) {
    $x = "<p class='welcome'>Welcome, <a class='removealine' href='account.php' title=''>" . $_SESSION['username'] . "</a></p>";
    require_once 'logindb.php.inc';
    $login = new localDB("connect.ini");
    $response = $login->myteam($_SESSION['username']);
} else {
    header('Location: accessdenied.php');
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" 
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fantasy Sport Guide</title>
</head>
コード例 #2
0
ファイル: registerdb.php プロジェクト: jonvidal/IT202
if (isset($_POST['signup'])) {
    function validateFormData($formData)
    {
        $formData = trim(stripslashes(htmlspecialchars($formData)));
        return $formData;
    }
    $formName = validateFormData($_POST['firstName']);
    $formLast = validateFormData($_POST['lastName']);
    $formEmail = validateFormData($_POST['emailAd']);
    $formUser = validateFormData($_POST['username']);
    $formPass = validateFormData($_POST['password']);
    if ($formUser == "" || $formPass == "" || $formEmail == "" || $formLast == "" || $formName == "") {
        $displayMessage = "<p class='login-error'>You Must Enter Username/Password</p>";
    } else {
        require_once "logindb.php.inc";
        $register = new localDB("connect.ini");
        $response = $register->addNewUser($formUser, $formPass, $formName, $formLast, $formEmail);
        if ($response['success'] === true) {
            header("Location: index.php");
            session_start();
            $_SESSION["username"] = $formUser;
        } else {
            $displayMessage = "Registration Failed:" . $response['message'] . "<p>";
        }
    }
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
コード例 #3
0
ファイル: Philadelphia76ers.php プロジェクト: jonvidal/IT202
<?php

session_start();
if (isset($_SESSION['username'])) {
    $x = "<span class='welcome'>Welcome, " . $_SESSION['username'] . "</span>";
} else {
    header('Location: accessdenied.php');
}
require_once "../logindb.php.inc";
$login = new localDB("connect.ini");
$teamId = 4;
$response = $login->nbaSelTeam($teamId);
include "nbapermissions.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" 
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="../css/layout.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NBA</title>
</head>

<body>
<div  class="container" id="Holder">
<div class="container" id="Header"><a href="index.php" title="Home"><img src="../logo.jpeg" alt="Fantasy Sports Guide" height="125"></a>

</div>
コード例 #4
0
ファイル: players.php プロジェクト: jonvidal/IT202
<?php

session_start();
if (isset($_SESSION['username'])) {
    $x = "<p class='welcome'>Welcome, <a class='removealine' href='account.php' title=''>" . $_SESSION['username'] . "</a></p>";
} else {
    header('Location: accessdenied.php');
}
require_once "logindb.php.inc";
$login = new localDB("connect.ini");
$response = $login->allnbaplayers();
include "permissions.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" 
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NBA Standings</title>
</head>

<body>
<div class="container" id="Holder">
<div class="container" id="Header"><a href="index.php" title="Home"><img src="logo.jpeg" alt="Fantasy Sports Guide" height="125"></a>
<div style="float:right;"><?php 
echo $x;
?>
コード例 #5
0
ファイル: process.php プロジェクト: jonvidal/IT202
    case "Login":
        $username = $_POST['username'];
        $password = $_POST['password'];
        $login = new localDB("connect.ini");
        $response = $login->validateUser($username, $password);
        if ($response['success'] === true) {
            $response = "Login Successful!<p>";
        } else {
            $response = "Login Failed: " . $response['message'] . "<p>";
        }
        break;
    case "Sign Up":
        $firstName = $_POST['firstName'];
        $lastName = $_POST['lastName'];
        $emailAd = $_POST['emailAd'];
        $userName = $_POST['userName'];
        $userPW = $_POST['userPW'];
        $register = new localDB("connect.ini");
        $response = $register->addNewUser($userName, $userPW, $firstName, $lastName, $emailAd);
        if ($response['success'] === true) {
            $response = "Registration Successful!<p>";
        } else {
            $response = "Registration Failed:" . $response['message'] . "<p>";
        }
        break;
}
echo $response;
?>


コード例 #6
0
ファイル: nba.php プロジェクト: jonvidal/IT202
<?php

session_start();
if (isset($_SESSION['username'])) {
    $x = "<p class='welcome'>Welcome, <a class='removealine' href='account.php' title=''>" . $_SESSION['username'] . "</a></p>";
} else {
    header('Location: accessdenied.php');
}
require_once "logindb.php.inc";
$login = new localDB("connect.ini");
$response = $login->nbaTeams();
include "permissions.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" 
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NBA</title>
</head>

<body>
<div  class="container" id="Holder">
<div   class="container" id="Header"><a href="index.php" title="Home"><img src="logo.jpeg" alt="Fantasy Sports Guide" height="125"></a>
<div style="float:right;"><?php 
echo $x;
?>
</div>
コード例 #7
0
ファイル: login.php プロジェクト: jonvidal/IT202
<?php

if (isset($_POST['login'])) {
    function validateFormData($formData)
    {
        $formData = trim(stripslashes(htmlspecialchars($formData)));
        return $formData;
    }
    $formUser = validateFormData($_POST['username']);
    $formPass = validateFormData($_POST['password']);
    if ($formUser == "" || $formPass == "") {
        $displayMessage = "<p class='login-error'>You Must Enter Username/Password</p>";
    } else {
        require_once "logindb.php.inc";
        $login = new localDB("connect.ini");
        $response = $login->validateUser($formUser, $formPass);
        if ($response['success'] === true) {
            header("Location: index.php");
            session_start();
            $_SESSION["username"] = $formUser;
        } else {
            $displayMessage = "<p class='login-error'>Login Failed: " . $response['message'] . "</p>";
        }
    }
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
コード例 #8
0
ファイル: nbastanding.php プロジェクト: jonvidal/IT202
<?php

session_start();
if (isset($_SESSION['username'])) {
    $x = "<p class='welcome'>Welcome, <a class='removealine' href='account.php' title=''>" . $_SESSION['username'] . "</a></p>";
} else {
    header('Location: accessdenied.php');
}
require_once "logindb.php.inc";
$login = new localDB("connect.ini");
$response = $login->nbaStandings();
include "permissions.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" 
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NBA Standings</title>
</head>

<body>
<div  class="container" id="Holder">
<div  class="container" id="Header"><a href="index.php" title="Home"><img src="logo.jpeg" alt="Fantasy Sports Guide" height="125"></a>
<div style="float:right;"><?php 
echo $x;
?>
</div>