Example #1
0
<?php

session_start();
require '../../vendor/autoload.php';
require_once '../helpers/variables.php';
require_once '../helpers/functions.php';
$token = getAccessTokenFromSession($provider);
$token_info = $provider->getTokenInfo($token);
?>

<html>
<head>
    <title>Token Info</title>
</head>
<body>

<h2>Token Info</h2>
<ul>
    <li>Token: <?php 
echo $token_info->token;
?>
</li>
    <li>Expired: <?php 
echo $token_info->expired ? 'True' : 'False';
?>
</li>
    <li>Expires In: <?php 
echo $token_info->expires_in;
?>
</li>
Example #2
0
<?php

session_start();
require '../../vendor/autoload.php';
require_once '../helpers/variables.php';
require_once '../helpers/functions.php';
$token = getAccessTokenFromSession();
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $filename = $id . '.tiff';
    $save_path = getcwd() . '/' . $filename;
    $incomingFax = $provider->getIncomingFax($token, $id, $save_path);
} else {
    echo "I don't know the ID";
    exit;
}
?>
<html>
<head>
    <title>Incoming Fax - <?php 
echo $_GET['id'];
?>
</title>
</head>
<body>

    <?php 
header('Content-type: image/tiff');
header('Content-Length: ' . filesize($save_path));
header('Content-Disposition: attachment; filename=' . $filename . '');
while (ob_get_level()) {