Beispiel #1
0
function getMessagesArray()
{
    global $MENSAGENS;
    $content = readFileContent($MENSAGENS);
    $json = json_decode($content, true);
    return $json['mensagens'];
}
Beispiel #2
0
function removeEventParticipation($eventId, $userId) {
	global $REMOVE_PARTICIPATION_URL;
	return readFileContent("$REMOVE_PARTICIPATION_URL&id=$eventId&membre=$userId");
}
<?php

include_once "functions.php";
//Não permite que a página seja carregada sem os parâmetros obrigatórios (data e email)
if (!(isset($_GET['email']) && isset($_GET['data']))) {
    header('Location: index.html');
}
$data = parseDate($_GET['data']);
$email = $_GET['email'];
$msg = readFileContent("messages/{$data}{$email}.json");
$email = $_GET['email'];
?>
<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="css/style.css"/>
    <meta charset="UTF-8"/>
    <title>Mensagem</title>
    <style>
    a {
        text-decoration: none;
        color: black;
        font-weight: bold;
    }
    </style>
</head>
<body>
<section>
    <h1>Mensagem de <?php 
echo $email;
?>
Beispiel #4
0
<?php
include_once '../inc/io.php';
session_start();

$receivedLogin = '';
$receivedPassword = '';
$errorMessage = '';
$result = array();

if(isset($_GET['login'])) $receivedLogin = $_GET['login'];
if(isset($_GET['pwd'])) $receivedPassword = $_GET['pwd'];

try {
	global $LOGIN_URL;
	
	$loginResult = readFileContent("$LOGIN_URL&id=$receivedLogin&pw=$receivedPassword");
	$errorMessage = getErrorMessage($loginResult);
	$isLoggedIn = isLoggedIn($loginResult);
	
	if ($isLoggedIn) {
		$username = getUserNameFromContent($loginResult);
		
		$result = array(
			"username" => $username
		);
	}
	$result["loggedIn"] = $isLoggedIn;
} catch (Exception $e) {
	$errorMessage = $e->getMessage();
}