PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Chouchen   Shiki PHP Proxy Request to Another Server   index.php   Download  
File: index.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Shiki PHP Proxy Request to Another Server
Retrieve and zip a file from a remote server
Author: By
Last change:
Date: 4 years ago
Size: 782 bytes
 

Contents

Class file image Download
<?php
// No display, log everything
error_reporting(E_ALL);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log',dirname(__FILE__).'/error.log');

// include everything
include_once 'FileToZip.php';
include_once
'FileToZipDispatcher.php';
include_once
'ToDownloadIndex.php';
include_once
'FileToZipEmail.php';

$action = filter_input(INPUT_GET, 'action');
$possibleActions = array('download', 'form', 'shortcut');

define('BASE_URL', 'http://mywebsite.com');

if(
$action == null || !in_array($action, $possibleActions)){
   
header('HTTP/1.0 404 Not Found');
    exit;
}

if(
$action == 'form'){
    include_once
'index.html';
    exit;
}

if(
$action == 'download'){
    include_once
'download.php';
    exit;
}

if(
$action == 'shortcut'){
    include_once
'shortcut.php';
    exit;
}