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

 

 

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.