doucitan2544 2012-05-01 18:55
浏览 27
已采纳

跨PHP页面发送信息

i have an ajax / php feature of my site that pulls in information from a table every 20 seconds. The information is about hobbie's

It displays on the page the name of the person and their hobby. I have a second page that acts as an information source for that hobby. Currently the only way to access the second page is by entering your hobby into a form on the first page. How would i get it so that i could click on the hobby that is being displayed on the homepage and access an information page on the hobby.

To access the information it currently grabs the hobby from a POST command.

The table results are being displayed on the homepage via

echo $row['name']." is interested in ".$row['hobby'];

Could i some how pass the hobby name through to another page? I only know how to do it through form submits.

  • 写回答

3条回答 默认 最新

  • dprxj1995 2012-05-01 19:02
    关注

    I don't think that sesssions are necessary for this.

    Look at what information your form is sending. If you're making a GET request you can add that url to a link.

    So on your home page you could have links like the one below instead of forms.

    <a href="/hobbies/?name=remote+controlled+cars>Remote Controlled Cars</a>

    So with the link it would no longer be using $_POST but $_GET instead.

    Psudeo code for your homepage link below. <a href="/hobbies/?name=<?php echo slugify($row['hobby']); ?>><?php echo $row['hobby']; ?></a>

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

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题