views:

19

answers:

1

Hi Guys I have installed LAMP server on suse linux on Amazon. Here is the server info

Basic 32-bit Amazon Linux AMI 1.0 (AMI Id: ami-08728661) Amazon Linux AMI Base 1.0, EBS boot, 32-bit architecture with Amazon EC2 AMI Tools.

I am trying to pass some special charters through a URL to PHP script but am not able to get it using $_GET['data'] in php.

THIS WORKS localhost/test.php?data=testdata

THIS FAILS localhost/test.php?data={testdata

so the special character "{" fails for some reason.... IS is apache or php encoding problem?

Any help would be highly appreciated.

A: 

Url can only contain ASCII character set, so special characters can not be there. You need to urlencode you parameters.

$data = urlencode($data);
http://localhost/?data=$data
abhinavlal
I did encode the URL, it was still failing. I was getting empty result for data soooo weird, eh? :S