473,503 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to guard against SQL injection in PHP?

mikek12004
200 New Member
Most of my previous project were done with MySQL so using mysql_real_escape_string() made me feel a little more secure. Is there any function like this for mssql in PHP?
Feb 26 '09 #1
3 1999
ck9663
2,878 Recognized Expert Specialist
You have to parse your T-SQL before you send it to SQL Server. This makes it more a PHP question that a SQL Server. PHP gurus can help you more with this.


-- CK
Feb 26 '09 #2
mikek12004
200 New Member
I see...Sorry didn't think it when making the post ;)
Feb 27 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
you could use a Database Abstraction Layer like PDO or MDB2, which a) allow you to use your code with different data bases and b) allow you to use prepared statements (see SQL Injection @ Wikipedia).
Feb 27 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1646
by: Griff | last post by:
I have a multi-page ASP web application that uses information sent to it from the client in the Request.Forms collection, the Request.QueryString collection and the Request.Cookie collection. ...
6
4332
by: Tor Erik Soenvisen | last post by:
Hi, How safe is the following code against SQL injection: # Get user privilege digest = sha.new(pw).hexdigest() # Protect against SQL injection by escaping quotes uname = uname.replace("'",...
4
3514
by: JBiggsCC | last post by:
I have a very simple login page which takes an ID number via a HTML form GET. What is easiest way to check that ID number against an Access DB to see if it exists? I want to redirect with the...
1
4137
by: yawnmoth | last post by:
Say I have the following in a PHP script of mine: $sr=ldap_search($ds, "", "(& (sn=$_GET) (givenName= $_GET*))"); If $_GET contains a ), an attacker could escape out of the first part of the...
4
3367
by: kkshansid | last post by:
i have a database as table name school field name location eg in location column data green school,tagore garden,chink road,jammu i want to make search on location such that when user enter ...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.