GumSlone wrote: if you do it the same way like in my examples everything will be ok.
ok but i did as methulj mentioned.. covered all requests.. so its safe . right?
have a look on methulj code sir.
Started on the old forum in May 2012 · view the original in the archive · old links redirect here
GumSlone wrote: if you do it the same way like in my examples everything will be ok.
ok but i did as methulj mentioned.. covered all requests.. so its safe . right?
have a look on methulj code sir.
analyzer wrote: metulj - mysql_real_escape_string() cannot stand alone. . . Like what you did. . htmlspecialchars and striptags was added which is better.
of cause it can stand alone, striptags and html special chars is another story, and we talk here about prevention of mysql injection, so mysql_real_escape_string will do the job.
Advertise your mobile site for FREE with AdTwirl
Well i dont think there is more to add, Gumslone already said it all. Most developers on here confuse mysql_real_escape_string and htmlspecialchars. Ive seen a lot of times where some apps here pass data to the database using the htmlspecialchars function. Thats wrong. mysql_real_escape_string and proper coding practice can handle injection just fine. htmlspecialchars should be used ONLY to escape special characters that might be stored in the DB harmlessly but could come out to be potential XSS attacks. For instance someone posted in a forum:
<b>This is an injected html code.
When fetching from the database, it would save u alot of heartache if you just escape with htmlspecialchars that way the browser doesnt interprete the < b > as html tags but as string. Thats where that function comes into play, not for sql query escaping.