mysql_real_escape_string HELP!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • eynesilli
    replied
    Originally posted by something else View Post
    not always but depends on how your mysql query's are scripted
    mysql_real_escape_string() backslashes things such as ' and " however an injection can be as simple as:
    PHP Code:
    OR 1 
    
    (no quotes ^ )



    use:
    [php]
    $message = mysql_real_escape_string($message);

    Thanks, but still did not understand anything

    Leave a comment:


  • metulj
    replied
    Originally posted by icedroplet1987 View Post
    Hey friends, i will like to know if i parse all data thru
    mysql_real_escape_string
    then will it protect my site from sql injection?? and its dark-sides?? any harm using it??
    likewise this for all get , post, server etc

    $msg = mysql_real_escape_string( $_GET['msg'] );

    please leave your valuable comments @ all
    Originally posted by analyzer View Post
    mysql_real_escape_string() will not be enough brother.
    i dont see why that wouldnt be enough...?? you mind to explain ?

    other than that... i do prefer this
    PHP Code:
    $msg = mysql_real_escape_string(strip_tags(htmlspecialchars($_GET['msg']))); 
    
    just to ''sleep better''

    Leave a comment:


  • analyzer
    replied
    mysql_real_escape_string() will not be enough brother.

    Leave a comment:


  • something else
    replied
    Originally posted by icedroplet1987 View Post
    Hey friends, i will like to know if i parse all data thru

    mysql_real_escape_string

    then will it protect my site from sql injection?? and its dark-sides?? any harm using it??

    likewise this for all get , post, server etc

    $msg = mysql_real_escape_string( $_GET['msg'] );

    please leave your valuable comments @ all
    not always but depends on how your mysql query's are scripted
    mysql_real_escape_string() backslashes things such as ' and " however an injection can be as simple as:
    PHP Code:
    OR 1 
    
    (no quotes ^ )

    Originally posted by eynesilli View Post
    if($message!=""){
    if(isspam($message))$spam=" reported='1',";
    else $spam="";
    $res=mysql_query("INSERT INTO inbox SET text='".$message."', byid='".getuid_sid($sid)."', toid='".$who."',$spam timesent='".time()."'");
    use:
    [php]
    $message = mysql_real_escape_string($message);

    Leave a comment:


  • wap-ruler
    replied
    rep

    Originally posted by eynesilli View Post
    if($message!=""){
    if(isspam($message))$spam=" reported='1',";
    else $spam="";
    $res=mysql_query("INSERT INTO inbox SET text='".$message."', byid='".getuid_sid($sid)."', toid='".$who."',$spam timesent='".time()."'");

    What do u mean by how to plz describe.

    Leave a comment:


  • eynesilli
    replied
    how-to here?

    PHP Code:
    if($message!=""){
    if(isspam($message))$spam=" reported='1',";
    else $spam="";
    $res=mysql_query("INSERT INTO inbox SET text='".$message."', byid='".getuid_sid($sid)."', toid='".$who."',$spam timesent='".time()."'"); 
    
    Last edited by arnage; 26.05.12, 14:58.

    Leave a comment:


  • icedroplet1987
    replied
    thnx sir

    Leave a comment:


  • GumSlone
    replied
    yes it will

    Leave a comment:


  • icedroplet1987
    started a topic mysql_real_escape_string HELP!!

    mysql_real_escape_string HELP!!

    Hey friends, i will like to know if i parse all data thru

    mysql_real_escape_string

    then will it protect my site from sql injection?? and its dark-sides?? any harm using it??

    likewise this for all get , post, server etc

    $msg = mysql_real_escape_string( $_GET['msg'] );

    please leave your valuable comments @ all
Working...
X