|
Posted by Erwin Moller on 10/24/06 14:09
James54321 wrote:
> Ok so this is the text i type into the database:
>
> this is some 'example text' and is a "test"
>
> and this is what is displayed when its in the database:
>
> this is some \'example text\' and is a \"test\"
>
> is there anyway to stop that? or hide the backslahes?
>
> Thanks, James.
Hi James,
Your question is too vague to give a sensible answer.
What do you mean by 'type into database'?
Do you type directly into the database or do you use a html-form with PHP at
the backend inserting/updating the database?
If the latter, are you sure the backslashes are actually IN the database, or
do you see some output somewhere on a webpage that contains them?
Check this by direct querying the database from commandline. It is very well
possible they are added by PHP, and are stored just fine in the database.
I am not teasing you: The backslashmatter is very important to understand
for a programmer, because it protects against crackattacks like
SQL-injection.
Read more here:
http://nl2.php.net/manual/en/function.addslashes.php
Be sure to follow the links to:
stripslashes(), htmlspecialchars(), and get_magic_quotes_gpc().
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|