www.webdeveloper.com
Results 1 to 2 of 2

Thread: Scrubbing pasted input into MySQL

  1. #1
    Join Date
    Nov 2010
    Posts
    22

    Scrubbing pasted input into MySQL

    Is there a way to scrubb the form input that has been pasted into the form, before inserting into MySQL? After posting the data that was pasted into the form I see a large amount of filler junk in the table.

  2. #2
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    There are a lot of ways...


    You can type cast (int),(string),(float).
    You can pattern match (regex).
    You can filter by IP (whitelist/blacklist).
    You can filter based on session.
    You can filter based on IP & time.
    You can filter based on duplicate variables (two phone #s are the same).

    There's an insane amount of ways to filter and parse data. It depends a lot on what kind of data is supposed to be stored in the table. You can try captchas if you're receiving a large amount of spam, but even captchas have their limits.

    I would suggest preprocessing the form data before inserting it (using php if that's your language), but
    Mysql supports type casting, regular expressions, and unique indexes. It can store IP and time.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles