FollowText.com
 
 Welcome Guest Home | Submit Article | Contact | Search

FollowText.com » Internet » Web-development » Php » Points In PHP And SQL Security Topics Explained


Points In PHP And SQL Security Topics Explained

by: ChrisChanning
Total views: 9 | Word Count: 497


One of the biggest flaws in the PHP language is the fact that it allows for web developers to make very big mistakes in regards to security. One example of this is through SQL injections- an exploit that malicious users take advantage of when web developers don't accurately safeguard their application.

SQL injections are defined by the vulnerability in the SQL query that PHP developers make use of. When the developer in question puts forth an SQL query, he or she needs to make an effort to validate any input that could come from any web form or entry field. A simple input statement such as "a' OR 'a'='a'" could compromise the security of one's database with ease.

As long as we can escape the quote that needs to be used in the injection, we can prevent any type of harm that may come to a web application. The first way to accomplish this is to simply use magic quotes. It should be noted that magic quotes are no longer supported as of PHP 6, and shouldn't be used. Instead, we leave SQL injection prevention up to a newer and more dependable command.

The common way to protect against an SQL injection attack is to simply use the mysql_real_escape_string() function that PHP has support for. When passing POST values through this function, the result becomes an escaped string that can't be used to manipulate an SQL query- perfect for our situation.

Another good way to prevent SQL injections is to simply restrict authority in SQL users where possible. For instance: it would be a good idea to create individual users that do specific things: such as create a table or update rows in the said table. This can help make the task of ruining one's hard work much harder for malicious web users, although it's a lot more work for webmasters (Although well worth it).

It should be noted that programs and web applications that stop SQL injections should not be obtained- since they commonly cost quite a bit of money. As long as webmasters take precautions with what they create, there should be no reason to spend hundreds of dollars on software that only makes use of escape characters and formatting data correctly. This type of application is created to con webmasters into buying something they don't need- so dont fall victim to them!

Closing Comments

SQL injections are never a pretty sight. They ruin databases, can be a security risk to users of the website, and they even can destroy entire websites. Thus, it's good to either hire developers that know what they are doing or to brush up on some security topics by one's self. Doing so can save a world of hurt for a webmaster, as well as quite a bit of money from not having to buy mock applications that claim to do the "hard work" for webmasters. In the end, it's recommended developers pick up a good book or visit their favorite PHP security websites to stay informed.



About the Author

Learn more on SQL Injection Sample and PHP prevent SQL Injection.  



More Articles from: PHP

1: Points In PHP And SQL Security Topics Explained
    (By: ChrisChanning, On: Jul 16th 2008, Words: 497, Views: 9)
2: Differences Between Two Printing Commands In PHP
    (By: ZacharySchuessler, On: Jul 16th 2008, Words: 441, Views: 8)
3: How PHP Developers Differentiate Between Print And Echo
    (By: ZacharySchuessler, On: Jul 13th 2008, Words: 446, Views: 9)

FollowText.com » Internet » Web-development » Php » Points In PHP And SQL Security Topics Explained



Main Menu
Home
Login
Register Now!
Submit Article
Latest Articles
Search
Categories
Accounting
Beauty
Business
Career
Cars and Trucks
Computers
Culture and Society
Environment
Family
Finance
Fitness
Food and Drink
Free Tools & Resources
Health
Hobbies
Home
Humor
Inspirational / Motivational
Internet
    ASP
    CGI
    Cold Fusion
    CSS
    DHTML
    HTML
    Java
    Perl
    PHP
    Scripts
    SGML
    SMIL
    SSL
    XHTML
    XML
Internet Marketing
Legal Informations
Marketing
Men's Issues
Music
Personal Development
Pets and Animals
Politics
Psychology
Publishing
Recreation and Leisure
Relationships
Religion and Spirituality
Science
Speaking
Technology
Women's Issues
Writing

Algarve - A complete guide to all resorts in the Algarve.

Algarve Airport Transfers - An Airport Transfers company completely owned by ExPats.

Calling Cards - Lowest rates international calling card plans.

7 users online. 0.33s