dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Issues to consider when processing forms

  1. #1
    Join Date
    Feb 2006
    Posts
    5

    Question Issues to consider when processing forms

    What issues should you consider when accepting user supplied content from a web form and processing it within server side code to either store it in a database and/or redisplay it elsewhere on the site?

    Many thanks

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,636
    Basically, you use the appropriate escaping mechanism for the database interface being used when inserting it into the database (prepared statements with bound parameters, or a database-specific escaping function). When retrieving and outputting to the user, you can apply something such as PHP's htmlentities() function to convert applicable characters to their HTML character entities.

    I do not recommend applying htmlentities() type functions to the data prior to inserting it into the database, as you have then modified the raw data, which will both make it more difficult to search/sort and increase its storage size.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Feb 2006
    Posts
    5
    Thank you NogDog,

    Is this the only issue you might come across?

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,636
    I suppose there are always special cases for unique requirements, but the above will handle 99.9%* of the circumstances you're likely to encounter with most web apps.
    __________
    * 63.4% of all statistics are made up
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

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