Guest User

Untitled

a guest
Jan 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1.  
  2.  
  3. function clean($postVars)
  4. {
  5.  
  6. $len = count($postVars);
  7. $i=0;
  8.  
  9. $cleaned = array();
  10.  
  11. while($i < $len) {
  12. $cleaned[$postVars[$i]] = mysql_escape_string( strip_tags( html_entities($_POST[$postVars[$i]], ENT_QUOTES,'UTF-8') );
  13. $i++;
  14. }
  15.  
  16. return $cleaned;
  17. }
  18.  
  19. $fields = array('newUser','newPass','newPassConfirm','newMail');
  20. $data = clean($fields);
Add Comment
Please, Sign In to add comment