Advertisement
Guest User

Untitled

a guest
Jun 4th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2. // cleaning function
  3. // of course. the script must be connected to a database.
  4. function clean($data){
  5. if((function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc() == 1) || @ini_get('magic_quotes_sybase')){
  6. $data = stripslashes($data); // fix string
  7. }
  8. return mysql_real_escape_string( htmlentities( $data ) );
  9. }
  10. // start filtering $_POST, $_GET and secure any data within
  11. $data = array_merge($_POST, $_GET);
  12. foreach( $data AS $key => $val )
  13. {
  14. $data[ $key ] = clean( $val );
  15. }
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement