0

I am having an interesting problem with sending a $_GET variable. It's quite a long variable.

What I try to send (doesn't work):

http://site.com/test.php?url=http%253A%252F%252Ffilecrown.com%252Fkf3f6sh97d1v%252FAnda_-_Bartok_-_Children.part1.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252Ft3chpybkpv3u%252FAnda_-_Bartok_-_Children.part2.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252F1u9ajwa44u8y%252FAnda_-_Bartok_-_Children.part3.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252F9v5hak7ssv3u%252FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%252614%252628.part1.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252Flul0nem8awsk%252FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%252614%252628.part2.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252F93t2hhk973r0%252FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%252614%252628.part3.rar.html

print_r($_GET) output:

Array ()

What I try to send (works):

http://site.com/test.php?url=http%253A%252F%252Ffilecrown.com%252Fkf3f6sh97d1v%252FAnda_-_Bartok_-_Children.part1.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252Ft3chpybkpv3u%252FAnda_-_Bartok_-_Children.part2.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252F1u9ajwa44u8y%252FAnda_-_Bartok_-_Children.part3.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252F9v5hak7ssv3u%252FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%252614%252628.part1.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252Flul0nem8awsk%252FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%252614%252628.part2.rar.html%250Ahttp%253A%252F%252Ffilecrown.com%252F93t2h

print_r($_GET) output:

Array ( [url] => http%3A%2F%2Ffilecrown.com%2Fkf3f6sh97d1v%2FAnda_-_Bartok_-_Children.part1.rar.html%0Ahttp%3A%2F%2Ffilecrown.com%2Ft3chpybkpv3u%2FAnda_-_Bartok_-_Children.part2.rar.html%0Ahttp%3A%2F%2Ffilecrown.com%2F1u9ajwa44u8y%2FAnda_-_Bartok_-_Children.part3.rar.html%0Ahttp%3A%2F%2Ffilecrown.com%2F9v5hak7ssv3u%2FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%2614%2628.part1.rar.html%0Ahttp%3A%2F%2Ffilecrown.com%2Flul0nem8awsk%2FAnda_-_Beethoven_-_Piano_Sonatas_Nos.7%2614%2628.part2.rar.html%0Ahttp%3A%2F%2Ffilecrown.com%2F93t2h )

Is there a limit to a single $_GET variable size? I am confused why it stops working up to a certain point.

reefine
  • 873
  • 2
  • 13
  • 25
  • While Opera allows 2GB for GET parameters, most webservers limit the length however. And IE had around 2000 maximum in past versions. But you still seem within those bounds. – mario Apr 26 '11 at 01:16
  • Works for me, it's most certainly not a PHP limit. How exactly are you testing this? (web server, browser etc) – deceze Apr 26 '11 at 01:17
  • Testing with Chrome (latest), Nginx web server. – reefine Apr 26 '11 at 01:17
  • 1
    I think that the length of a URL that a web server will accept is implementation specific. Perhaps that's what you're running into? Are you able to send the data via POST instead? If POSTing works, then that might give you a hint as to what's busted, or what limitations you're up against. – Marvo Apr 26 '11 at 01:18
  • I will be posting the variables instead. Tested and works. Don't know why I didn't think of that ;) Thanks! – reefine Apr 26 '11 at 01:26

3 Answers3

2

These old questions should clear things up a little

What is the maximum possible length of a query string?

What is the maximum length of a URL in different browsers?

Community
  • 1
  • 1
Hubro
  • 56,214
  • 69
  • 228
  • 381
0

I'm not sure about how much is the limit in a GET variable, that limit is established by the browser you are using, I recomend that if you have to send a lot of information you should use POST instead of GET.

PachinSV
  • 3,680
  • 2
  • 29
  • 41
0

nginx throws a "Request Entity Too Large (413)" when the URI is too big for the server... so i read. The limit is set in the client_max_body_size option. But i don't know much about nginx.

Ethan
  • 400
  • 3
  • 14