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.

5
  • 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. Commented Apr 26, 2011 at 1:16
  • Works for me, it's most certainly not a PHP limit. How exactly are you testing this? (web server, browser etc) Commented Apr 26, 2011 at 1:17
  • Testing with Chrome (latest), Nginx web server. Commented Apr 26, 2011 at 1: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. Commented Apr 26, 2011 at 1:18
  • I will be posting the variables instead. Tested and works. Don't know why I didn't think of that ;) Thanks! Commented Apr 26, 2011 at 1:26

3 Answers 3

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?

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

1 Comment

This cleared things up for me. I will post these variables instead. Thanks!
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.

Comments

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.

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.