0

I have a two server.I am passing 4 variable in url ssid(36),rawstring(1024),sample_id,user_id. I simplely want to get parameter passed in url.When I hit my first server I am getting param,but same url(Only change server name),I get 3 parameters(not getting raw string). In my controller I am testing like this

    echo "<pre>";
    print_r($_REQUEST);
    echo "</pre>";
    echo $_REQUEST['rawstring'];die();

this is my desired output

    Array
    (
    [ssid] => d41d8cd98f00b204e9800998ecf8427e
    [rawstring] => 303330363036422031333235353030323039ffffffffffffffffffffffffffff33333030302041202046542031333238203030303030323831ffffffffffffff31362f30372f323031332d2d313035343031ffffffffffffffffffffffffffff0ba504d203430aeeffffffffffffffff00db00db02ca00db02caffffffffffff00000000ffffffffffffffffffffffffbe51ffffffffffffffffffffffffffff8000ffffffffffffffffffffffffffff00ec856cffffffffffffffffffffffff2ea495a82eaa959dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff30303031303030350000000900000bbf0013ac9e0013aca300003504fffffffb06b706ae06aa06a2069c06990690068e0000086a00000ad80013acc60013acc70013acc90013accd000034f7fffffffb06b206ae06a806a1069f0697068e068a0000086f00000ac6000000020013acd7000000000000000000000000000008c400000000000000000000000000000773ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2e656e64
  [readerid] => admin
  [sample_id] => 1111
)

But i am getting this

    Array
    (
    [ssid] => d41d8cd98f00b204e9800998ecf8427e
     [readerid] => admin
  [sample_id] => 1111
)

I have gone through this.But i don't think its working for me.I have seen htaccess file also.Its fine. My url is like

 <server_name>/Nfc/test/fromXML?ssid=d41d8cd98f00b204e9800998ecf8427e&rawstring=303330363036422031333235353030323039ffffffffffffffffffffffffffff33333030302041202046542031333238203030303030323831ffffffffffffff31362f30372f323031332d2d313035343031ffffffffffffffffffffffffffff0ba504d203430aeeffffffffffffffff00db00db02ca00db02caffffffffffff00000000ffffffffffffffffffffffffbe51ffffffffffffffffffffffffffff8000ffffffffffffffffffffffffffff00ec856cffffffffffffffffffffffff2ea495a82eaa959dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff30303031303030350000000900000bbf0013ac9e0013aca300003504fffffffb06b706ae06aa06a2069c06990690068e0000086a00000ad80013acc60013acc70013acc90013accd000034f7fffffffb06b206ae06a806a1069f0697068e068a0000086f00000ac6000000020013acd7000000000000000000000000000008c400000000000000000000000000000773ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2e656e64&readerid=admin&sample_id=1111

I am using zend.Please someone help me.

Community
  • 1
  • 1
Naeem
  • 36
  • 9
  • Can you show us how you're trying to pass the parameters through the URL? – Amal Murali Nov 04 '13 at 12:09
  • the one you need is in the $_SERVER not in the $_REQUEST superglobal – Royal Bg Nov 04 '13 at 12:10
  • @Amal Murali see updated question please – Naeem Nov 04 '13 at 12:12
  • @Royal Bg It will return all server information.I want only URL parameters – Naeem Nov 04 '13 at 12:14
  • @Naeem what do you want as output, can you show the example output you want to echo, based on the example of the url you've given? – Royal Bg Nov 04 '13 at 12:15
  • Do you want to get `303330363036422031333235353030323039ffffffffffffffffffffffffffff33333030302041202046542031333238203030303030323831ffffffffffffff31362f30372f323031332d2d3130353430...` as output – Royal Bg Nov 04 '13 at 12:15
  • 3
    The server can configure the length of POST or GET requests or concrete values. The [post You are linking to](http://stackoverflow.com/questions/7724270/max-size-of-url-parameters-in-get) has the answer clearly stated: if the server uses `suhosin` patch, it will restrict the param values to max. length of **512 characters**, unless proper setting is done. – shadyyx Nov 04 '13 at 12:17
  • @ Royal Bg see updated question – Naeem Nov 04 '13 at 12:19

1 Answers1

0

Well I found this solution

   if(@$_REQUEST['rawstring']=='' || !(@$_REQUEST['rawstring'])){

        $str=($_SERVER['QUERY_STRING']);
        // print_r(parse_str($str));
        $new=explode("&rawstring=",$str);
        $raw=explode("&readerid",$new[1]);
        $_REQUEST['rawstring']=$raw[0];

    }

Is there some better way to parse $_SERVER['QUERY_STRING']?

Naeem
  • 36
  • 9