Re: The variable $_SERVER['AUTH_USER'] gives domain\\username problem
| From: | Ramil Sagum | Date: | Fri, 01 Oct 2004 01:24:22 +0000 |
| Subject: | Re: The variable $_SERVER['AUTH_USER'] gives domain\\username problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36500@lists.php.net to get a copy of this message | ||
Thus wrote justin:
> Thanks Ramil,
>
> I knew it had something to do with the \, but I still can't figure out
> how to get the variable into the database without the extra '\'
> It is entered into the database via a form using the input below:
>
> <input name="ident" type="hidden" value="<?php echo
> $_SERVER[AUTH_USER];?>">
>
> Where would I use the mysql_real_escape_string ?
From the manual:
"This function will escape special characters in the unescaped_string,
taking into account the current character set of the connection so
that it is safe to place it in a mysql_query(). "
an example from the manual:
$query = sprintf("SELECT * FROM users WHERE user='%s' AND
password='%s'",
mysql_real_escape_string($user),
mysql_real_escape_string($password));
mysql_query($query);
I hope this is enough :)
----
ramil
http://ramil.sagum.net