Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross site scripting defense

Status
Not open for further replies.

jimmyshoes

Programmer
Jun 1, 2008
132
0
0
GB
I'm using htmlEditFormat() as a defence against cross site scripting. My question is where should you insert this function. If you are collecting data from a form, uploading it to a table and then later showing the data in the table, is it common practice to run htmlEditFormat() before you insert the data into the database table or is it better to save the data to the database in whatever form it is entered, and then run htmlEditForat() on the variables as they are output to the user during a later search?

Thanks
 
if you "save the data to the database in whatever form it is entered" you will eventually get hacked by SQL injection

htmlEditFormat is insufficient, by the way

for example, it won't stop "little bobby tables"

;-)

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top