SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    FBI secret agent digitman's Avatar
    Join Date
    Sep 2004
    Location
    Work
    Posts
    697
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    trimming variables before inserting them in a db?

    After I've checked data coming from a form submission and they contain no invalid characters at all,could it be a security issue if I dont trim() them before I insert them into a mysql database?What could be the negative impact of not trimming them?Here I've checked that the username starts with a letter and that they have a fixed length,and done the same for the password and all other values.Should I still trim them before I add them to the database?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if u dont allow spaces into usernames and passwords u dont need to trim white spaces.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •