--- whoisquilty <[EMAIL PROTECTED]> wrote:

> When I insert into my database from a form, there are slashes added before
> quotes. What do 
> I need to do to get rid of this?

As already noted, this is an issue with the magic_quotes parameter.  If you
expect to stay on the same server with the same configuration you can modify
each value with a stripslashes() function which will remove backslashes.  The
opposite function is addslashes().

When inserting data into MySQL, you often surround the data with single quotes
(though double quotes will work on MySQL) and use the backslash before a single
quote character in the string.

If you want to make your code more portable, you can use something like:

function fix_slash($in)
{
 $out = (ini_get('magic_quotes')) ? stripslashes($in) : $in;
 return $out;
}

James

Reply via email to