duangan6797 2016-08-08 07:59
浏览 201

PHP <a href =点击cookie的值

For a site I use one big PHP file wich generate all the pages, I use url transfer for the menu choice and that's what I want to change.

<li><a href="Index.php?s=I">Home<br></a></li>
<li><a href="Index.php?s=Z">About<br></a></li>

I want to loose the ?s=Z from the URL and pass the value 'Z' to a cookie when clicked and then reload the PHP file, read the cookie, and generate the page "About".

I was thinking and playing with "onclick", but this didn't work.

Regards,

Marco

  • 写回答

1条回答 默认 最新

  • dsf22567 2016-08-10 09:40
    关注

    With the help on another question I solved also this problem, it's a work around, but it does the trick.

    Basicly the solution was to look if there was a VAR at the end of the URL.

    If so, put the VAR in a cookie and reload the page without the URL VAR. After reload, read the cookie and execute the menu option.

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算