File: tests/csrf_test.php

Recommend this page to a friend!
  Classes of Marco Cesarato  >  PHP AIO Security Class  >  tests/csrf_test.php  >  Download  
File: tests/csrf_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/csrf_test.php
Date: 9 months ago
Size: 695 bytes
 

Contents

Download
<?php

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

ob_start();

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

?>
<!DOCTYPE html>
    <html>
    <head>
        <title>Form</title>
    </head>

    <body>


    <h1>Form</h1>
    <form action="#" method="POST">
        <div>
            <label>Author:</label>
            <input type="text" name="author" placeholder="Author's Name" />
        </div>

        <input type="submit" name="submit" value="Submit">
    </form>

    <h2>Response</h2>
    <?php
   
if (isset($_POST['submit'])) {
        echo
$_POST['author'];
    }
   
?>

    </body>
    </html>

<?php

die(Security::output(ob_get_clean()));


For more information send a message to info at phpclasses dot org.