Jump to content

sanitizing strings question


halben

Recommended Posts

 

I'm doing something like this:

 

$user_email_data = trim(strip_tags(stripslashes($_POST['user_email'])));
 
// Now use PHP to check for validation
if (filter_var($user_email_data, FILTER_VALIDATE_EMAIL)) { .....
 
 
How safe is that?

 

 

Validate and sanitize filters are different.  Sanitize will change it to make it "safe" and validate tells you whether it is valid or not.

Archived

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

×
×
  • Create New...

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.