Web Components Factory
Article Base
Author Options
New account
Read articles
Manage Articles
Submit Category
Terms of service

Client Products
Calendar
Time Selector
Text Link
Marks System
Menu
Menu Bar

Server Products
Sitemap Gen BETA
Photo Viewer
Poll Builder
Counter
Guest Book
Where am i?

LinkExchange
Directory
Link Exchange


My Collections
Description
ScreenShots
Download
Buy
Register

We received 384322 visits from 14607 distinct visitors, since 04-08-2007
From:
United States2157
China405
India366
Germany330
United Kingdom249
Canada190
Korea, Republic of182
Portugal166
Sweden137
France136
Romania123
Netherlands109
Spain98
Malaysia94
Russian Federation85
Italy83
Brazil82
Australia71
Philippines71
Turkey48
Rest of world: 9425
 

View Article Base
 
Serving 498 articles.
Articles > PHP (Programming Languages) > Points In PHP And SQL Security Topics Explained

Points In PHP And SQL Security Topics Explained
Created on 2008-07-20 03:32:51Nb. of Hits: 510Rating: No rating yet 

The number one security topic present in applications that use PHP is the SQL injection. This is because PHP allows for web developers to make unfortunate mistakes when it comes to creating their SQL queries. But thankfully, fixing the problem is easy: all that is necessary is a few tips in security.

An SQL injection attack is, simply put, a vulnerability in the SQL query that programmers unwittingly leave wide open. When a web developer calls an SQL query, he or she will commonly forget to escape quotes that the user might input. Users might input text such as \"MyVariable' OR 1=1--\" ; this line will actually give the malicious user to your database!

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!

Final Thoughts

There isn't much effort that needs to be exerted in order to declare a database safe from harm. All that is needed is a little prevention- which comes from avid usage of the function and design principles previously stated. It may also be a good idea to use SQL injection scanners on large web applications to cover holes that might not have been covered over the course of the development period.

Chris Channing - Learn more on here.
 
[Back]
 
Rate this article
Brilliant
Very good
Good
Average
Bad
Null
 
[Back]
 
Comments
You should login in order to register your comments.
 
[Back]
 
 
More articles from this author
Find The Best Computer Screensaver For Free with 244 hit(s) and no rating yet
Getting The Best Of What The Internet Has To Offer with 304 hit(s) and no rating yet
How To Find The Most Interesting Websites On The Internet with 315 hit(s) and no rating yet
The Fling FTP Client Reviewed with 333 hit(s) and no rating yet
Why Satellite Internet Has Become Popular In Rural Areas with 327 hit(s) and no rating yet
The PHP Include Construct Easily Explained with 288 hit(s) and no rating yet
Why Internet Forums Are Popular with 270 hit(s) and no rating yet
How To Watch Comedy Videos Online with 242 hit(s) and no rating yet
A Brief Guide To Tech Gadgets with 173 hit(s) and no rating yet

 

Read our last 20 Articles
 
From author George Pearson Shearsmith in category General Web Marketing>Search Engine Optimization
Search Engine Rank Reporting Software Can Help Your Website
If you have launched a website, then you should know that it is very important that you get it listed on various search engines. If you do not get traffic to your site, you cannot possibly earn any profits from it. People have to be able to find your site or there is really no point in having one. There are many ways in which search engine rank reporting software can benefit you. It helps you keep track of where your site ranks on such engines.
 
From author Joe Thomas in category Software>Training
Excel VBA training Can Take Your Excel Usage To The Next Level
Almost all computer users know Microsoft Excel to some degree and most are aware of macros and VBA. However, the vast majority shy away from VBA assuming it to be the preserve of Excel gurus and professional programmers. Nothing could be further from the truth: having Excel VBA training is a natural progression for anyone who knows Excel well and want to take their knowledge to the next level.
 
From author Jason Kendall in category Programming Languages>C# development
C Programming Career Courses At Home - Update
With an abundance of computer courses on offer these days, it's best to take advice from a training organisation who can guide you on the right one for you. Reputable organisations will familiarise you with the differing job options that might suit you, in advance of recommending a training path that will give you the knowledge you need.
 
From author in category Internet>Forums
Website + Google adsense account @3000
Instant Cash Machine is nothing but Internet's best Free Income generating opportunity. This Income opportunity is offered by Google Adsense. Today million's of people are making a handsome income every month. There are many webmasters (people who run their websites) who are earning more than $50,000 every month without any effort. Well this sounds Fishy, but its true$50,000 every month without any effort. Well this s Email : info@indiagoogleworld.com Phone no : 9052559825 Area : India Location : Hyderabad y, but its true URL: http://www.indiagoogleworld.com/Adsense.htm
 
From author Mark Alexander Smith in category General Web Marketing>Search Engine Optimization
Search Engine Optimization for Dummies
Search Engine Optimization sounds difficult to most. One reason being that search engines are very technical things and the other being that the word optimization has five syllables. But in truth Search Engine Optimization is not an exact science, even though the companies that advertise this service will make it out to be. The steps that are outlined in this article will help you to optimize your site correctly at the design stage of your website.
 
From author Rachel Ray in category Internet>Providers
Outsourcing Staff: Benefits of Remote staff, Offshore and Online staff
This rise in the need for outsourcing staff caused numerous Business Process Outsourcing or BPO companies to mushroom in different parts of the world, more specifically in developing countries such as China, India and the Philippines. Why developing countries? Developing countries have a rich labor resource for price that’s almost 70% cheaper compared to hiring local office staff!
 
From author David Domingues in category Programming Languages>PHP
How to create a simple Database Access Layer (DBAL)
Defining all accesses to a MYSQL database on a dynamic page can be painful when you have a lot of information fields to manage. This small class is the beginning for a database layer abstraction (DBAL). Using it, you will never have to make a query again, deal with its syntax, know where to put quotes and not, know what the primary keys of the tables are, etc.... In fact, this information already exists in a database called information_schema. If performance of a site is not the main issue and you want it to make your site maintainable before all, then using this information to simplify the life of the programmer can be the key. But know that these kind of things, and by extension every DBAL, Object Relational Mapper (ORM), like Doctrine for instance, or frameworks like Cake or Zend have huge costs in terms of performance, but will ease your job. It's only a question of choice...
 
From author Matthew Parker in category Software>Training
SAP Training & Courses - What Can It Do For Your Career
Well before reflecting upon that query lets have a quick recap of what we are talking about. When we verbalize about SAP, we are verbalizing about a world industry leader in ERP (Enterprise Resource Planning) software. In fact SAP is the third biggest software enterprise of the globe, with over12000 enterprises using SAP, having round 80,000 installations and over 12,000,000 individuals making use of it. Hence rest assured whatever you are planning to do with SAP, you are managing with something serious and verified over the yrs.
 
From author Rachel Ray in category General discussion>Human resources
Outsourcing Virtual Assistant Jobs: You've got a Choice from Recruitment Service Companies
You can easily take your pick from the various outsourcing jobs like a virtual assistant that are now needed by many businesses. They can hire you on a short or long term basis depending upon the project requirements from recruitment services and recruitment companies. All you need to have is a small home office with a computer unit with a broad band or DSL connection and you can start your foray your chosen career path.
 
From author Rachel Ray in category General discussion>Human resources
Call Centre, Contact Centre, Telemarketers, Telemarketing Staff, Customer Service & CSR Career Guide
If you are considering this BPO service or just being a call centre or contact centre agent, Telemarketer/s and Telemarketing staff, customer service rep or CSR interest you, then this is the right time to read this.
 
From author David Domingues in category Programming Languages>Ajax
Simple Ajax Tutorial - Updating part of your form without reloading all
If you are thinking about turning your webpage into a desktop application, you should think about Ajax programming. Ajax will make your site more user-friendly, avoiding the full refresh each retrieval of data requires when calling server functions
 
From author David Domingues in category Programming Languages>CakePHP
Multi-language country combobox
Helper to instantly build a combobox with countries in 6 different languages based on XML data retrieval.
 
From author David Domingues in category Programming Languages>PHP
How to divide query results into various pages. The navigation paginator class in PHP
When you retrieve a large amount of rows from a database consultation, you might want to display your result in several pages instead of having everything listed on a very long page. The paginator component might help the programmer to minimize the impact of transforming a simple data display into a complex multipage management display.
 
From author David Domingues in category Programming Languages>PHP
How to create a complete set of thumbnail images, based on a folder path, and display the created content in PHP
If you have a folder with images and want to show those images on your website, you will probably think about showing thumbnails of each of them. This way you will be able to better organize your content and minimize the download time on the page by considerably reducing the size of the images. Additionaly, the user will be able to see the full size image by clicking on the thumbnail picture.
 
From author Get Google Ads For Free Scam Review Blog in category General Web Marketing>Pay per click advertising
Google AdWords Ads Now Free? Are You Kidding me?
Welcome to the Get Google Ads For Free Scam Review Article. This is the Google AdWords Ads Now Free Article. A new breakthrough secret is all you now need in order to get your Google AdWords pay-per-clicks FREE
 
From author Gugu Maseko in category General Web Marketing>Ecommerce
Guidelines to Free Internet Advertising and Website Promotion
Advertising online can bring more traffic then paid advertising, classified ads being more popular. Most of free classified ads web sites give you the power to facilitate marketing with features such as classified ads submitter forms.
 
From author Chris Channing in category General Web Marketing>Web hosting
Why Premium Web Hosting Is Better For Your Website
There are numerous web hosting companies on the internet, including both free and premium accounts. A lot of people choose a free account because they cannot afford a premium, or don't want to shell out the cash. Premium accounts are always the better option, and with packages available in all shapes and sizes, you can definitely get your money's worth.
 
From author Medium Light in category General Web Marketing>Ecommerce
Blind Leading The Home Business Blind
Internet Marketing is as old as the Internet itself. A good knowledge of email marketing, websites and search engines will be additives to your income & success. Understand the value of seeking out wisdom in various arenas of life.
 
From author Marco Maseko in category Software>Viruses, Trojans, Worms, Spyware
What You Should Know On Adware and Spyware Attacks
Have you noticed a suspicious slow down of your computer's processing without any particular reason? Are you bombarded by unsolicited pop up ads that indiscriminately appear whether you are running a program or not? These symptoms may continue to happen despite checking your system and running you're recently updated anti virus program to run diagnostics on your computer.
 
From author Andrew Whiteman in category Software>Tips & Tricks
Excel 2007 Formula And Function Basics
As you probably know, to create an Excel formula, you begin by typing an equal sign: this distinguishes it from other types of data. A formula consists of a series of expressions. There are three key components in these expressions: arithmetic operations, such as add and subtract; Excel functions; and cell references.
 
Articles
DHTML
Falling image from the to...
Dynamise image behaviour ...
PHP
Differences In Two Common...
How to create a simple Da...
Points In PHP And SQL Sec...
How to build a dynamic se...

Top Rated
What To Expect From Dell ... 5/5 (General considerations)
Nofollow 101 - Understand... 5/5 (Search Engine Optimization)
How to divide query resul... 5/5 (PHP)
Cool Tools and Firefox Ex... 5/5 (Search Engine Optimization)
How to create a complete ... 5/5 (PHP)
How to make a dynamic for... 5/5 (C# development)


Sponsors
 
Free Downloads from download.com
 
Free Downloads from FreewareFiles
 
Free Downloads from SnapFiles.com
 
FilesLand.com
 
Free Downloads from Tucows
 
Russian site about Portugal