![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| |||
| Wrap all your input fields with this function prior to Inserting and you should be alright PHP: mysql_real_escape_string - Manual__________________ Day Cares | Golf Courses | Disc Golf Courses | Campgrounds | Ice Rinks | Paintball Fields | Dentists | Plastic Surgeons | Aging Jokes Catholic Churches | Lutheran Churches | Methodist Churches | Episcopal Churches | Clean Jokes |
| |||
| Code: $sql = "Insert Into TABLENAME (Field1) Values ('".mysql_real_escape_string($fieldVal1)."'); __________________ Day Cares | Golf Courses | Disc Golf Courses | Campgrounds | Ice Rinks | Paintball Fields | Dentists | Plastic Surgeons | Aging Jokes Catholic Churches | Lutheran Churches | Methodist Churches | Episcopal Churches | Clean Jokes |
| ||||
| Here it is an example of one insecure php code that could be easily to attack: PHP Code: they can simply insert unproper data like they insert '; DELETE user.. like this into your username input. you sql query will be something like SELECT * FROM users WHERE user=''; DELETE user... Your query will not perform like you expect. To avoid it you can do like that ccoonen have said by using mysql_real_escape_string and the code will be looking like this PHP Code: No more attack.... |
| The Following User Says Thank You to siLenTz For This Useful Post: | ||
HelloWorld (07-09-2007) | ||
| |||
| cool, just make sure you fix the $username line $username = mysql_real_escape_strin($username); should be $username = mysql_real_escape_string($username); __________________ Day Cares | Golf Courses | Disc Golf Courses | Campgrounds | Ice Rinks | Paintball Fields | Dentists | Plastic Surgeons | Aging Jokes Catholic Churches | Lutheran Churches | Methodist Churches | Episcopal Churches | Clean Jokes |
| |||
| I think this is a great thread. Security is very important. I now have a better understanding of how SQL attacks are committed. |
![]() |
| Thread Tools | |
| Display Modes | |
| |