Jump to content

User Inputs!


ckrudelux
 Share

Recommended Posts

Very interesting, but god damn is that a dense bit of code! I have only just started to look into PHP and it's at once powerfully elegant and dense as rock.
Link to comment
Share on other sites

You shouldn't need regular expressions for safety.htmlspecialchars() and mysql_real_escape_string() are enough for strings, and for numbers you only need intval() or floatval() (int is a number without decimals, float is a number with decimals).Regular expressions are used to see if E-mail addresses or phone numbers have the right format, but they don't do anything for security.

Link to comment
Share on other sites

Regular expressions actually come from Unix.

Okay.. what symbols to replace I know some but not all of them?
Depends where your data is headed for. For example, if it was intended for a CSV file you might want to remove commas outside strings.
Link to comment
Share on other sites

You shouldn't need regular expressions for safety.htmlspecialchars() and mysql_real_escape_string() are enough for strings, and for numbers you only need intval() or floatval() (int is a number without decimals, float is a number with decimals).Regular expressions are used to see if E-mail addresses or phone numbers have the right format, but they don't do anything for security.
Okay... Then I know :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...