PHP Classes

File: tests/security_test.php

Recommend this page to a friend!
  Classes of Marco Cesarato   PHP AIO Security Class   tests/security_test.php   Download  
File: tests/security_test.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP AIO Security Class
Filter untrusted data to prevent security issues
Author: By
Last change: Update of tests/security_test.php
Date: 3 years ago
Size: 911 bytes
 

Contents

Class file image Download
<?php

require_once '../src/Security.php';
use
marcocesarato\security\Security;

Security::putInSafety();
Security::cleanGlobals();

ob_start();

echo <<<HTML
<!DOCTYPE html>
<html>
<head>
  <title>Globals Test</title>
</head>
<body>
  <h1>Security Test</h1>
  <h3>From here is possible test output security, CSRF, WAF (Firewall) and external form request protection</h3>
  <h3>You can also test the AntiDOS refreshing the page many times (hold pressed F5)</h3>
  <form action="#" method="POST">
    <label>Username</lable>
    <input type="text" name="username"><br>
    <label>Password</lable>
    <input type="password" name="password"><br>
    <button name="submit" type="submit">Login</button>
  </form>
</body>
</html>
HTML;

if (isset(
$_POST['submit'])) {
    echo
'<h3>Result</h3>';
    echo
'<pre>';
   
var_dump($_POST);
    echo
'</pre>';
}

$output = Security::output(ob_get_clean());
echo
$output;