dtxb75622 2016-10-06 18:21
浏览 7
已采纳

$ _GET在HostPapa环境中不起作用

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:

  1. When the second test page is in the php/ directory to mimic my application, $_GET does not work.
  2. 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!

  • 写回答

1条回答 默认 最新

  • dsshsta97935 2016-10-14 16:54
    关注

    HostPapa support finally fixed the issue:

    We have increased "suhosin.get.max_value_length" value for your account and this issue has been fixed now.

    It only took them 9 days (during which the app was obviously down) and my reopening the ticket twice as well as sending in a complaint.

    FYI: I switched hosting provider 5 days ago to PeoplesHost.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码
  • ¥50 silvaco GaN HEMT有栅极场板的击穿电压仿真问题