$ _GET character length limit?

I have a variable consisting of

  // The First Page (hello.php)

 $a = 'goto.php?a_56=63525588000&url=http://www.example.com/site/DISC+cUSTOMc+Studio+24+-               +Windows/1142766.p?
       id=1218224802931&usi=1142766&cmp=RMX&
       ky=2crslw0k9ZOM0ciu2rqi4NsYY7eQnnEyP';

 // The Second Page (goto.php)
 $r = $_GET['url'];

 echo $r; 

//http://www.example.com/site/Disc cCustomc Studio 8 - Windows/1142766.p?id=1218224802931

Why is he clipped?

+3
source share
4 answers

This is not a length issue, because you want one of your GET parameters ( urlin this case) to contain a character &. You need urlencodethis character, otherwise it will be interpreted as another GET parameter in the request, and not as part of the parameter url.

When urlencoding &becomes %26, and your query string becomes one,

goto.php?a_56=63525588000&url=http://www.example.com/site/DISC+cUSTOMc+Studio+24+-+Windows/1142766.p?id=1218224802931%26usi=1142766%26cmp=RMX%26ky=2crslw0k9ZOM0ciu2rqi4NsYY7eQnnEyP
+3
source

It is truncated because it treats &url in your parameter as the actual separator of the GET parameters, if that is not the case.

URL- urlencode().

+3

& / .

urlencode, .

+3

Ampersand is used to separate parameters in the outer query string. You will need to URL encode it if you want to use it in the GET parameter.

+3
source

All Articles