![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
In addition to what the others have said, I'd like to point out a huge security hole. I've reformatted the code for clarity, but the following is logically equivalent to what you have:
Never allow user to be able to send data directly to the database like this. If you do, you open yourself up to SQL injection attacks where the attacker can insert their own SQL and run it arbitrarily against the server. You can protect against this by using the $dbh->quote method on the variables before you insert them. However, a cleaner strategy is to always use placeholders:
Read "Placeholders and Bind Values" in the DBI documentation for more information. Cheers, New address of my CGI Course. In reply to Re: Need help with syntax error in CGI script (security hole)
by Ovid
|
|