I pass a json encoded array in the URL that looks something like this:
http://mywebsite.com/php/edit.php?event={...a bunch of values...}
In the edit.php page I retrieve the array like this:
if(isset($_GET['event'])){
$eventData = json_decode($_GET['event'],true); #return an array
}
This works beautifully in my local wamp environment (on localhost).
This works beautifully in GoDaddy environment.
DOES NOT work in HostPapa environment. It does not seem to see the 'event' parameter, isset() is not returning true.
I am completely baffled and don't even know what to say or ask HostPapa support (if anything).
Does anybody have any idea what the cause for this could be?
Is there a setting of some sort that I should be looking at?
I would really VERY MUCH appreciate some help. Please.
Update: I only encounter this issue when passing the array. When I don't use an array, it works!
Update #2: @Phil suggested a LimitRequestLine issue and I passed that on to HostPapa support (3X) but they kept ignoring it. I finally created 2 test pages for them to mimic the problem outside of my application. A test page in root with a button which when clicked opens a second page with array parameter, in root/php/ demonstrating the fact that $_GET is not working.
HostPapa support ignored that also.
HostPapa supports final email to me read (among other things):
“It seems that you are using incorrect code, hence you are requested to thoroughly check the code present inside your files.”
and closed my ticket.
During the creation of the 2 test pages for support I learned this:
- When the second test page is in the php/ directory to mimic my application, $_GET does not work.
- If I put both pages into the root directory and therefore shortening the URL including query string by 4 characters, $_GET works just fine.
So unfortunately in this particular case the solution is to change my hosting provider to someone that will actually provide support. As a small business I cannot afford these lengthy downtimes, it costs me money and does not instill confidence in my clients when my app doesn't work.
A big THANK YOU to @Phil for his help!