PHP Classes

File: call.php

Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP AJAX Calculator   call.php   Download  
File: call.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP AJAX Calculator
Perform calculations and get the results via AJAX
Author: By
Last change:
Date: 4 years ago
Size: 701 bytes
 

Contents

Class file image Download
<?php
/**
 * @author Pierre-Henry Soria <pierrehenrysoria@gmail.com>
 * @copyright (c) 2015, Pierre-Henry Soria. All Rights Reserved.
 * @license MIT License <http://www.opensource.org/licenses/mit-license.php>
 * @link http://github.com/pH-7/
 */

if (isset($_GET['op'], $_GET['lho'], $_GET['rho']))
{
    try
    {
        require
'Calculator.php';
        echo (new
Calculator($_GET['op'], $_GET['lho'], $_GET['rho']))->xmlOutput(); // PHP 5.4 syntax, access on instantiation
   
}
    catch (
Exception $oE)
    {
       
file_put_contents('exception.log', $oE->getMessage() . PHP_EOL . PHP_EOL, FILE_APPEND); // Create a log file
       
return false;
    }
}