View Single Post
  #2 (permalink)  
Old May 5th, 2008, 01:39
CloudedVision's Avatar
CloudedVision CloudedVision is offline
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 21 Times in 21 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: How to secure scripts and pages

Just make sure they can't close the quotes in a query. Let's say your query is this:

PHP: Select all

$query "SELECT * FROM `mytable` WHERE `blah`='".$_GET['blee']."'"
If the hacker does something like "hello'yo" for the blee text field, they've just closed out of the quotes, and can run wild. So be sure to replace all the "'" with "\'", and you should be fine.
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Reply With Quote