\"Look at me\" by YURIA
Escape characters
Started by Dat, Aug 29 2007 03:20 PM
4 replies to this topic
#1
Posted 29 August 2007 - 03:20 PM
Right now I created a working basic form that will input data into my database once I click submit. But when I look in my database through PHPmyadmin. it shows escape characters and I don't want that. How do I input data without the escape characters.
#2
Posted 29 August 2007 - 08:09 PM
Exactly where does it show those?
If you pull them out of the database and display them with PHP or from command prompt, do they still show?
If they are there already, you may have to manually remove them and place them back in (or automate the task with some str_replace()... kind of risky with large data though), and make sure when you are entering the data through PHP, to use the correct method, so as to not 'double-escape' anything.
If you pull them out of the database and display them with PHP or from command prompt, do they still show?
If they are there already, you may have to manually remove them and place them back in (or automate the task with some str_replace()... kind of risky with large data though), and make sure when you are entering the data through PHP, to use the correct method, so as to not 'double-escape' anything.
#3
Posted 29 August 2007 - 10:27 PM
Demonslay, on Aug 29 2007, 06:09 PM, said:
Exactly where does it show those?
If you pull them out of the database and display them with PHP or from command prompt, do they still show?
If they are there already, you may have to manually remove them and place them back in (or automate the task with some str_replace()... kind of risky with large data though), and make sure when you are entering the data through PHP, to use the correct method, so as to not 'double-escape' anything.
If you pull them out of the database and display them with PHP or from command prompt, do they still show?
If they are there already, you may have to manually remove them and place them back in (or automate the task with some str_replace()... kind of risky with large data though), and make sure when you are entering the data through PHP, to use the correct method, so as to not 'double-escape' anything.
When I echo this out like...so for example:
if (!isset($_POST['submit'])) {
} else {
$title = mysql_real_escape_string( $_POST['title'] );
mysql_query( "INSERT INTO `anime_reviews` (`title`) VALUES ($title)")
echo $title
it come out as \\\"Another\\\" add for testing
Then when I look at it in my database via PHPmyadmin i see \"Another\" add for testing
So I think it's php: something to do with $_POST perhaps?
Edited by Dat, 29 August 2007 - 10:28 PM.
#4
Posted 29 August 2007 - 11:08 PM
Your logic seems a little flawed to me, that or you stripped some code.
if(!isset(...)){
}else{
// Is the same as...
if(isset(...)){
}
Anywho, you probably have magic quotes enabled.
#5
Posted 29 August 2007 - 11:35 PM
rc69, on Aug 29 2007, 09:08 PM, said:
Your logic seems a little flawed to me, that or you stripped some code.
if(!isset(...)){
}else{
// Is the same as...
if(isset(...)){
}
Anywho, you probably have magic quotes enabled.Well it did make a difference when I tested it ! with: Works. Without ! doesn't.
I solved this problem using stripslashes() Thank you.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
