2

I have a problem while try to send compressed array through url in php. Here what i have tried so far. I have a array like this.

Array
(
    [0] => 191
    [1] => 192
    [2] => 193
    [3] => 194
)

then I compressed it using json_encode like below:

$compress_data = json_encode($cid);

and try to pass that data through url like below:

<a href='index.php?option=com_audits&controller=audits&task=createcsv&create=success&cid=<?php echo $compress_data?>&tmpl=component' target="_blank">
                    <img src="<?php echo JURI::root().'images/csv_button.png'?>" width="18" border="0" height="18">
</a>

It all works fine for rest of the browsers but not in IE. when I checked it then i realize it get breaks in between when first double quote occurred in json data. I don't know why is it happing as this works for all other. Is there any way to solve it.Please help.

1
  • You might like check out this link if it helps Commented Oct 28, 2013 at 5:45

1 Answer 1

2

You need to use urlencode($compress_data) instead of $compress_data because url string must respond to RFC: http://www.faqs.org/rfcs/rfc3986.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.