duankuaizhe8257 2018-07-13 08:35
浏览 56
已采纳

如何通过href传递(“/”)

I am passing an id containing / eg: 171/CR/EOW1/14 in the link.

It is showing correctly, but in the controller function it is taking only the first letters before the slash. eg: 171

How do I solve this problem?

enter image description here

  • 写回答

5条回答 默认 最新

  • douwang6635 2018-07-13 08:42
    关注

    Your question is incredibly vague. But for the purposes of this, I'll assume that you want to pass the whole string 171/CR/EOW1/14. Not parts of the string as different params.

    you are using an un-escaped slash. So codeigniters' routing thinks the parts of the url after the 171 are more parameters in the route string.

    if you want to pass a url, use urlencode() and then urldecode() to handle the slashes in the string you want to pass.

    Or use addslashes().

    addslahes()

    urlencode()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭