Jump to content

will stripslashes remove user added slashes?


jasonc

Recommended Posts

Simple question about slashes.

 

If a user uses slashes in their text will all of them be removed using 'stripslashes' function or only the ones that have the  '

to the right of the slashes. ?

 

sorry posted before its time.....

 

 

peoples names like...

 

 

 

o'grady

 

o'murphy

 

shows on the screen as

 

o\'grady

 

and

 

o\'murphy

 

 

Yes it will remove user entered \ characters.

 

You should only use stripslashes on get/post/cookie data IF magic_quotes_gpc is ON. There is a function to test the magic_quotes_gpc setting - get_magic_quotes_gpc

ok this is what happend, the data is inputed in the form and then added to the database, mysql, using

 

mysql_real_escape_string  or addslashes not sure...

 

  function db_input($string, $link = 'db_link') {
    global $$link;

    if (function_exists('mysql_real_escape_string')) {
      return mysql_real_escape_string($string, $$link);
    }
    return addslashes($string);
  }

 

later on when my admin replies to posts it is showing their names with \ in the name that have the hyphens  '  in them

 

how do i print and add to a string their names but not remove the \ or / added by the user in the other text areas of the form they fill out.

 

there are no \ / in the database  just the correct names,  o'grady,  o'murphy.

 

why does this \ get added when the data is grabbed from mysql ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.