1

I want to post an input box that have single quote inside it to a php file.I've used ' but it sends some backslashes:

<input type="hidden" name="legal_natural" value="$store_info[&#39;legal_natural&#39;]">

result:

$store_info[\'legal_natural\']

Please tell me how can I avoid backslashes when I post ' to a PHP file?

blurfx
  • 1,270
  • 11
  • 22
Sadegh
  • 327
  • 2
  • 20

1 Answers1

0

See this : SO Question

Here's an answer from that question:

Assume you want to send the $content variable instead of just stripping the backslashes, Consider to use urlencode() instead of rawurlencode(). Also, you can use the function once for your $content variable.

$content = urlencode($content);

UPDATE: both urlencode and rawurlencode may not fit your case. Why don't you just send out the $content without URL encode? How do you send our the query string? If you are using cURL, you do not need to encode the parameters.

Community
  • 1
  • 1
code
  • 2,115
  • 1
  • 22
  • 46