dqjmq28248 2013-07-19 06:54
浏览 217
已采纳

PHP:在$ _GET-Param中使用带有多个其他Params的$ _GET-Param

yeah, I know, the title is kind of confusing, but no better title came to my mind. Here is my problem:

I want to use a link in my application, which would look like this: localhost/index?jumpto=some_folder/somescript.php?someparam1=1234&someparam2=4321

The problem is that &someparam2 is meant to hang on the second $_GET-Param. It would be like this: localhost/index?jumpto=some_folder/somescript.php?someparam1=1234&someparam2=4321

Instead, PHP interprets that &someparam2 hangs on the first $_GET-Param. localhost/index?jumpto=some_folder/somescript.php?someparam1=1234&someparam2=4321

Does anyone know a solution for this?
I already tried
localhost/index?jumpto='some_folder/somescript.php?someparam1=1234&someparam2=4321'
but of course that didn't work.

I hope you can understand my problem. Thank you for your time.

  • 写回答

1条回答 默认 最新

  • dsfovbm931034814 2013-07-19 06:58
    关注

    You will need to URL encode your string some_folder/somescript.php?someparam1=1234 so that php will not parse & in the query string as a param separator.

    use urlencode("some_folder/somescript.php?someparam1=1234");

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

报告相同问题?

悬赏问题

  • ¥15 vhdl+MODELSIM
  • ¥20 simulink中怎么使用solve函数?
  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题