Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-16-2008, 12:35 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
PHP and mySql

Well I was chatting with some folks from phpfreaks.com.

They confirmed some good practices to protect your website.

1. Filter all content entered into the database
2. Escape all content comming from the database.


So you can use mysql_real_escape_string() and stripslashes() to remove stuff that can mess up the query.

Then you use htmlentities() to prevent users from entering php or other scripting languages and having that be executed.

Html entities basically takes the strings and converts the characters into html code.

If you use htmlentities when adding content to the mysql table and decide later on to crop the text at a certain length, it will expose the html code because it will crop that too.

Hope this helps someone starting out.
__________________
Reply With Quote
  #2  
Old 07-16-2008, 01:25 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Depending on your data, and what your wanting to do with it, encoding the data to base64 also works
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Problem or PHP? Webviper2006 Web design and Programming 3 12-26-2005 12:17 AM
PHP/MySQL Jeff Web design and Programming 7 11-30-2005 12:18 PM
php/mysql problem need help G.I.JOE*MFA* Web design and Programming 3 02-09-2004 05:20 PM
PHP, MySQL REGULATOR Web design and Programming 7 11-22-2003 11:53 AM
php and mysql XenoMorpH Web design and Programming 4 04-01-2003 06:14 AM


All times are GMT -5. The time now is 03:58 PM.




Powered by vBulletin®