Jump to content

Archived

This topic is now archived and is closed to further replies.

localhost

securing $_get, $_post

Recommended Posts

I want to secure these two as best as possible, for $_POST I am using htmlspecialchars, and trim. I want to refrain from using addslashes/stripslashes.
What else should I use?

Share this post


Link to post
Share on other sites
i know you said you wanted to refrain from using add/stripslashes, but this is what i use, and it's been okay thusfar:
[code]
function clean_var($value){
  if (get_magic_quotes_gpc()) { stripslashes($value); }
  if (!is_numeric($value)) { mysql_real_escape_string($value); }   
  return $value;
}
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.