Jump to content

[SOLVED] Quick security question.


NerdConcepts

Recommended Posts

Almost all of my php pages include many instances where a sql connection is needed. To keep myself from having to keep coding the SQL stuff I run the connection within the header of the page and close the connect at the footer. By doing this am I opening up myself to a security problem. In my mind I am not, but the books I have seem to close the sql connect before HTML begins. My problem is that inside the HTML I need a database connection to pull information from the database. Just wondering I guess.

Link to comment
https://forums.phpfreaks.com/topic/82146-solved-quick-security-question/
Share on other sites

I don't think there's a security problem there.  Just make sure you sanitize any user provided data that goes into database queries.  There's no need to close the connection early for security (though it's often good for performance reasons).

Thanks, that is all I needed to know. The only information that goes into the database that is user supplied are when they register, leave comments, or modify their account settings. Which in that case it goes through very tight processing to make sure the data supplied isn't dangerous in any way.

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.