duanmiaosi0150 2014-03-20 20:57
浏览 66
已采纳

在新服务器上格式化GET序列化数据

I had set up a demo web app on my personal server. When a user submits the info on the form, the array of info is sent through the form. It worked fine on my server. When I moved it to a new server, it no longer sends the correct information. I noticed the string is slightly different. Is there some sort of setting I need to change on the new server?

For both sites, I chose February and submitted the form.

The string that gets passed on the old server:

months=a%3A1%3A%7Bi%3A0%3Bs%3A1%3A"2"%3B%7D

The string that gets passed on the new server:

months=a%3A1%3A%7Bi%3A0%3Bs%3A1%3A%5C"2%5C"%3B%7D

The data is collected from the get with:

$months = $_GET['months'];
$dates = unserialize(urldecode($months));

The data is added to the form as a hidden field using this variable:

$dateserial = htmlspecialchars(serialize($dates));
  • 写回答

1条回答 默认 最新

  • duandi1636 2014-03-20 21:02
    关注

    magic_quotes_gpc is enabled in php.ini on the new server and "magically" escaping quotes with a \ which is translated into %5C by urlencode.

    So turn it off.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!