Secure the values given by the user in PHP
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
secvals.php
test.php

README

#This is secvals,#

a way to secure the data given by the user in PHP.

##Usage:##

At the beginning of every PHP file you should include secvals.php, and call

secure_vals(array(
   'key'  => 'type',
   'key2' => 'type2'
));

Where the key is the variable's key in $_POST or $_GET and the type is one of the supported types (eg. float, email, timestamp).

The function will create a $_SGET and $_SPOST with the secure and validated data. Use them instead of $_GET || $_POST!

Original author: Zoltan LENGYEL <warnew@brow.hu>