Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
Video Content Creator
pramukag
Updated:
Yesterday at 6:10 AM
Ad icon
QA Engineer Intern
pramukag
Updated:
Yesterday at 6:07 AM
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Thursday at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Jun 21, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
mysql database injection akak gahuwoo.pls help...!!
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="mr90486" data-source="post: 16764045" data-attributes="member: 123289"><p><span style="font-size: 15px"><span style="color: RoyalBlue"> Say you have a database tables named 'categories' and 'blogs'. each 'blog' belong to some 'category'. now lets say you want to see all blogs of category 1. the url for this request will look like : <a href="http://mysite.com/viewblogs.php?cat=1" target="_blank">http://mysite.com/viewblogs.php?cat=1</a> . now when the user click on this link viewblogs.php can access it via $_GET['cat'] variable. now the script puts this category id (1) into an sql query. something like "SELECT * FROM blogs WHERE catid = $_GET['cat'] . this is where sql injection can happen. the attacker can modify the url request with something malicious. instead of ?cat=1 he can replace the value (1) with something else which forms a malicious sql query. lets say something like ?cat=1;drop ... which will cause database to be deleted. This is only one example, there are other ways to perform mysql injection. The other area is Form input. </span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue">To avoid this, you must always validate and sanitize user submitted data. </span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue">check the following links:</span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"><a href="http://www.veracode.com/security/sql-injection" target="_blank">http://www.veracode.com/security/sql-injection</a></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"><a href="http://www.homeandlearn.co.uk/php/php13p5.html" target="_blank">http://www.homeandlearn.co.uk/php/php13p5.html</a></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"><a href="http://www.programmerinterview.com/index.php/database-sql/sql-injection-example/" target="_blank">http://www.programmerinterview.com/index.php/database-sql/sql-injection-example/</a></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"><a href="http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/" target="_blank">http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/</a></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"><a href="http://shiflett.org/articles/sql-injection" target="_blank">http://shiflett.org/articles/sql-injection</a></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue"></span></span></p><p><span style="font-size: 15px"><span style="color: RoyalBlue">I don't know whether this explanation is clear or not but check out the above links so you can get a clear picture of what's going on and how to prevent it</span></span></p></blockquote><p></p>
[QUOTE="mr90486, post: 16764045, member: 123289"] [SIZE="4"][COLOR="RoyalBlue"] Say you have a database tables named 'categories' and 'blogs'. each 'blog' belong to some 'category'. now lets say you want to see all blogs of category 1. the url for this request will look like : [url]http://mysite.com/viewblogs.php?cat=1[/url] . now when the user click on this link viewblogs.php can access it via $_GET['cat'] variable. now the script puts this category id (1) into an sql query. something like "SELECT * FROM blogs WHERE catid = $_GET['cat'] . this is where sql injection can happen. the attacker can modify the url request with something malicious. instead of ?cat=1 he can replace the value (1) with something else which forms a malicious sql query. lets say something like ?cat=1;drop ... which will cause database to be deleted. This is only one example, there are other ways to perform mysql injection. The other area is Form input. To avoid this, you must always validate and sanitize user submitted data. check the following links: [url]http://www.veracode.com/security/sql-injection[/url] [url]http://www.homeandlearn.co.uk/php/php13p5.html[/url] [url]http://www.programmerinterview.com/index.php/database-sql/sql-injection-example/[/url] [url]http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/[/url] [url]http://shiflett.org/articles/sql-injection[/url] I don't know whether this explanation is clear or not but check out the above links so you can get a clear picture of what's going on and how to prevent it[/COLOR][/SIZE] [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom