Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

SQL Injection vulnerable ?

I would like your opinion on this method to avoid any sql injection :

My request to database is always like this:

PHP Code

<?php 
$request 
= odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [%NAME%] WHERE %value%=\''.mssql_escape_string($_GET['%GETPARAM%']).'\''); 

My function mssql escape string :

PHP Code

<?php 
function mssql_escape_string($string) {
        
$replaced_string = str_replace("'", "''", $string);
        return 
$replaced_string;
    } 


Thx
Look into prepared statements. php.net/manual/en/mysqli.quickstart.prepared-statements.php
Prepared statements are NOT always enough.

https://stackoverflow.com/questions/6017...ion-in-php


Possibly Related Threads...
Thread / Author Replies Views Last Post
by MaalssDec 24, 2024 11:17 AM 18 748 Dec 24, 2024 11:17 AM
Last Post: nihg45
by gituser102May 27, 2024 11:10 AM 3 439 May 27, 2024 11:10 AM
Last Post: gituser102
by lgfINCMay 14, 2024 10:29 PM 3 861 May 14, 2024 10:29 PM
Last Post: RonyKingSourcing