Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // cleaning function
- // of course. the script must be connected to a database.
- function clean($data){
- if((function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc() == 1) || @ini_get('magic_quotes_sybase')){
- $data = stripslashes($data); // fix string
- }
- return mysql_real_escape_string( htmlentities( $data ) );
- }
- // start filtering $_POST, $_GET and secure any data within
- $data = array_merge($_POST, $_GET);
- foreach( $data AS $key => $val )
- {
- $data[ $key ] = clean( $val );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement