PHP Classes

File: WIInstall/WICore/WIClass/WIAjax.php

Recommend this page to a friend!
  Classes of Jules Warner   WICMS   WIInstall/WICore/WIClass/WIAjax.php   Download  
File: WIInstall/WICore/WIClass/WIAjax.php
Role: Example script
Content type: text/plain
Description: Example script
Class: WICMS
Database driven content management system with PDO
Author: By
Last change:
Date: 7 years ago
Size: 1,078 bytes
 

Contents

Class file image Download
<?php
include_once 'WI.php';

//csrf protection
if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest')
    die(
"Sorry bro!");

$url = parse_url( isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
if( !isset(
$url['host']) || ($url['host'] != $_SERVER['SERVER_NAME']))
    die(
"Sorry bro!");

$action = $_POST['action'];


switch (
$action) {

 case
'requirements':
       
$require = new WIRequirements();
       
$require ->Required();
        break;

 case
'db_settings':
    
$DB = new WIDBSeetings();
    
$DB->TestDB($_POST['host'],$_POST['db'],$_POST['user'],$_POST['pass']);
        break;

case
'install_settings':
    
$install = new install();
    
$install->Installer($_POST['name'],$_POST['dom']);
        break;
       
        default:
       
        break;
}

//switch($_GET['action']){
       
        //case "getEvents":
        //$calendar = new WICalendar();
        //$calendar->getEvents($_GET['date']) ;
        //break;
       
       // default:
      // break;
   // }