Questions tagged [magic-quotes]

A security process that automatically escapes incoming data to the PHP script.

A security process that automatically escapes incoming data to the PHP script. In summary, all ' (single-quote), " (double quote), \ (backslash) and NULL characters are escaped with a backslash automatically.

This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

60 questions
0
votes
4 answers

Seeking quoted string generator

Does anyone know of a free website or program which will take a string and render it quoted with the appropriate escape characters? Let's say, for instance, that I want to quote It's often said that "devs don't know how to quote nested "quoted…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
0
votes
5 answers

PHP keeps escaping my form's input (adding \ behind my ')

So basically when I type something with an apostrophe, such as John's bike it will echo John\'s bike. The code below:
Haskella
  • 41
  • 3
  • 7
0
votes
3 answers

PHP - Shorter Magic Quotes Solution

I'm writing a app that needs to be portable. I know I should disable magic quotes on the PHP configuration but in this case I don't know if I can do that, so I'm using the following code: if (get_magic_quotes_gpc() === 1) { $process =…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
0
votes
1 answer

How to turn off magic quotes in PHP configuration file? I am using XAMPP

What is the file? I have php.ini and php.ini-dist on my computer.
Steven
  • 24,410
  • 42
  • 108
  • 130
0
votes
3 answers

Function escaping quote is not working correctly

I'm trying to figure out why this function does not work correctly. It's adding an extra \ every time I edit my entries. Online server has these settings: magic_quotes_gpc On magic_quotes_runtime Off magic_quotes_sybase Off Here is the…
lena
  • 119
  • 1
  • 12
0
votes
1 answer

Getting by magicquotes that pop up in PHP scripts

My style of programming requires the use of Word, and magic quotes cannot be turned off on the machine I work on without breaking other Word utilities I use. I need a way to clear magic quotes automatically and, if possible, remotely from a PHP…
0
votes
3 answers

PHP using a variable in a mysql query with magic_quotes

I have a mysql query that uses a value in an array as part of the WHERE statement. How am I supposed to include this variable? Here is the sql: "AND gender = '{$user_array[\"gender\"]}'" PHP returns this error: Parse error: syntax error, unexpected…
Don P
  • 60,113
  • 114
  • 300
  • 432
0
votes
3 answers

Why should we escape double quotes,single quotes creating queries in PHP

Why should we escape double quotes,single quotes creating queries in PHP? are there any particular benefits when doing that? or it is just a good practice?
user962206
  • 15,637
  • 61
  • 177
  • 270
0
votes
2 answers

wordpress magic quotes by php code

I have wordpress installation where the magic quotes is set ON in the phpini file. this cause that every quote is duplicated every time I update a post. I can't change the phpini is out of my capability, so the only way is by php code. the parameter…
0
votes
1 answer

php adds backslash when printing quoted value but i dont want it to do that

In my database, there is a value something like that: i haven't done it yet. p.s: in the database the value is exactly the same here, there is no backslash. When I print it php adds backslash before ' single quote. get_magic_quotes_gpc is off. I…
Murat
  • 978
  • 7
  • 17
0
votes
1 answer

PHP Magic Quotes adding slashes to template file?

I have a default site template I use for my site like below:
PHPLOVER
  • 7,047
  • 18
  • 37
  • 54
-1
votes
1 answer

How can I replicate magic_quotes functionality in a XAMPP PHP7.4 server?

First of all, I understand that magic_quotes causes all kinds of problems and has no place in modern PHP. I'm in a very specific situation where I've upgraded XAMPP from PHP 5 to PHP 7.4 for an intranet site comprised of more than 5000 files.…
kdsprogrammer
  • 136
  • 1
  • 13
-1
votes
1 answer

Special characters problem with database

I am trying to add special characters into database with JavaScript using encodeURIComponent but it works in localhost and in server adding ' an extra / is also added infront of ' . How to prevent this? This is what I have so far: var qn_text =…
Rabeesh
  • 1
  • 2
-1
votes
3 answers

Stripslashes doesn't work for my magic-quotes in PHP

I have started using magic quotes and I have encountered a small problem, an easy problem I guess which I can't figure out. I wan't to use striplashes which it does not remove when I write something in my textarea Code:
Alexein
  • 666
  • 1
  • 11
  • 19
-2
votes
1 answer

How does magic quotes access the array element containing "-" in name?

I was going through a manual and found a statement saying "if array element used with '-' as the word separator, the array's element can be accessed by magic quotes".. but didn't provided with any explanations on it. could some one explain the…
OM The Eternity
  • 15,694
  • 44
  • 120
  • 182
1 2 3
4