Jump to content

PHP Security Question


thePhpLady

Recommended Posts

Hi everyone!

I have a question that might sound silly...

I have stored in my database a url to a pic and some other data.

I am unsure if when I retreive data from my database I need some sort of protection. I usually sanitize and prevent SQl injections when I code forms but I am not sure if I have to do the same when I get data from the database.

 

Thanks for your help.

 

Veronica

Link to comment
https://forums.phpfreaks.com/topic/257260-php-security-question/
Share on other sites

In terms of SQL injection, no there isn't anything you need to do once something in the database.

There's still XSS injection to think about though. Verify the data is what you expect it to be before inserting it into the database, and use htmlentities() when echoing it out into your HTML.

 

I usually sanitize and prevent SQl injections when I code forms

"Usually" isn't enough.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.