Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
PHP XSS SLQi protection
SUBMITTED BY:
Guest
DATE:
Nov. 15, 2013, 4:19 p.m.
FORMAT:
PHP
SIZE:
356 Bytes
Raw
Download
Tweet
HITS:
850
Go to comments
Report
<?php
function
xsssql
(
$dirty
){
if
(
get_magic_quotes_gpc
())
{
$clean
=
mysql_real_escape_string
(
stripslashes
(
$dirty
));
}
else
{
$clean
=
mysql_real_escape_string
(
$dirty
);
}
return
htmlentities
(
$clean
);
}
// hot to use:
$user
=
$_GET
[
'user'
];
$query
=
"SELECT * FROM users WHERE user='"
.
xsssql
(
$user
)
.
"'"
;
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus