Esempio n. 1
0
<?php

include_once "/var/www/php/sql_connect.php";
if ($token[0] === "\$") {
    $uid = getUserIDFromToken($token);
    $result = getHunterStats($uid);
    #User is not participating
    if (!isset($result)) {
        echo "<center><button class='btn btn-default btn-lg' onclick='addUserToEvent()'>Participate in the Event</button>";
    } else {
        ?>

				<div class="jumbotron">
					<div class="container">

						<div class="row">
							<div class="col-lg-3">
								<center>
									<img src="<?php 
        echo $result[3];
        ?>
" style="width: 200px; height: 200px;">
									<br>
									<br>
									<form role="form" action="index.php" method="POST" enctype="multipart/form-data">
										<input class="btn" type="file" name="hpic">
										<br />
										<button class="btn btn-default">Confirm Choice</button>
										<div id="picerr"><?php 
        echo $img_text;
        ?>
Esempio n. 2
0
 * Created by PhpStorm.
 * User: Misumoo
 * Date: 5/7/2015
 * Time: 12:11 PM
 */
session_start();
class userInfo
{
    public $userfirstname;
    public $usertoken;
}
require 'class.Database.php';
require 'class.Email.php';
require 'phpmailer/PHPMailerAutoload.php';
isset($_COOKIE['usertoken']) ? $usertoken = $_COOKIE['usertoken'] : ($usertoken = "");
$userid = getUserIDFromToken($usertoken);
//our json data
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$task = $request->task;
//first thing before we perform anything is to make sure our user is actually in the database
if (!$userid || $usertoken == "") {
    // no id is bound to this token
    //as a non logged in user, our only tasks can be login and register
    if ($task != "login" && $task != "register" && $task != "resetDo" && $task != "resetInit") {
        $task = "";
        $data = array("success" => false, "message" => "No userid or token");
        echo json_encode($data);
        exit;
    }
}