View Single Post
Old 05-09-2006, 04:29 AM   · #18
yabsoft
NamePros Member
 
Trader Rating: (0)
Join Date: Sep 2004
Posts: 29
NP$: 10.00 (Donate)
yabsoft is an unknown quantity at this point
Yea,'mysql_real_escape_string' is better then 'mysql_escape_string'.

Thanks for your advance!

Originally Posted by SecondVersion
mysql_escape_string is deprecated, I'd rather use something like:
PHP Code:
<?php

function make_safe($value)
{
  
$value = stripslashes($value);
  
$value = (function_exists('mysql_real_escape_string')) ? mysql_real_escape_string($value) : addslashes($value);

  return
$value;
}

?>

.
PHP Code:
$db->setQuery("select * from setting where admin='".make_safe($input['user'])."' and pass='".make_safe($input['pass'])."'");



Please register or log-in into NamePros to hide ads
yabsoft is offline   Reply With Quote
Site Sponsors
domainsubway.com Build your NameBrand free webhosting
Advertise your business at NamePros
All times are GMT -7. The time now is 12:13 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.