PHP Classes
elePHPant
Icontem

File: view.php

Recommend this page to a friend!
  Classes of Mike Gamble  >  PHP Token Parser Engine  >  view.php  >  Download  
File: view.php
Role: Example script
Content type: text/plain
Description: Example script to be used with index.php
Class: PHP Token Parser Engine
Parse PHP code to check if it matches syntax rules
Author: By
Last change: Fixed error with header file name. Removed a function that I snagged from StackOverflow.
Date: 5 years ago
Size: 1,762 bytes
 

 

Contents

Class file image Download
<?php
if ( ! isset($_GET['f'])){
   
header("Location: index.php");
    die();
}
require_once(
"token_engine.php");
$eng = new token_engine();
$file = urldecode($_GET['f']);
if ( !
is_file($file)){
   
header("Location: index.php");
    die();
}

$fileContent=file_get_contents($file);
$eng->set_code($fileContent);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<title>File View</title>
<style type="text/css">
<!--
* {
margin: 0;
padding: 0;
}
body {
    background-color: #FFFFFF;
    color: #000000;
    padding:10px 45px 10px 45px;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    font-size: 13px;
}
div.code {
    background-color: #E1E5F4;
    margin:20px 0 20px 0;
    padding:10px 0;
    font-family: "Lucida Sans Unicode", Tahoma, Helvetica, sans-serif;
}
.code p {
    text-indent: 0;
    margin: 0;
}
.red, .triggers {
    color: #990000;
}
.light {
    background-color: #EDEEF2;
}
table{
    table-layout: fixed;
    width: 100%;
    padding-bottom: 45px;
}
td{
    padding: 2px 45px;
    word-wrap: break-word;
}
td.triggers{
    width: 150px;
}
.mtop10{
    margin-top:10px;
}
h3{
    margin: 10px 0 25px 45px;
}
-->
</style>
</head>
<body>
    <p class="mtop10"><a href="index.php" target="_self">Return to Scanner</a></p>
    <div class="code">
        <h3>File View: <?php echo $file; ?></h3>
        <?php
        $eng
->display_code_table();
       
?>
</div>
</body>
</html>