dtja73027 2013-06-16 10:28
浏览 21
已采纳

是否有可能以标签形式从选项卡到选项卡传递MySQL记录“id”?

I'm not sure how to explain this clearly so here is the link to what I am trying to do

demo

Basically you get to this form from a MySQL search results page, you click on a record and it sends you to this page and passes the record id in the borswer. So clicking on row 20 will pass ?id=20 in the browser and display in the first tab all that customer info that's called for on that form.

What I want to do is to be able to click on a tab and view the rest of that same customers info that is called for in each of the different tabs.

Right now all I can do is view the info in the first tab, if I move to a new tab nothing is there obviously because the id doesn't pass.

How can I pass the id from tab to tab? I've got session_start(); at the top of every page but that doesn't seem to be doing anything!

  • 写回答

1条回答 默认 最新

  • dousi4472 2013-06-16 10:32
    关注

    Pass it as a get parameter in the URL, so that your id is always referenced in the URL of each tab in the section. Each tab will pass the id on to the other tabs, as follows:

    Your search results would then link to, e.g.: customer_contact.php?id=123

    And your tabs would each grab the id like this:

    <?php
        if (!isset($_GET['id'])) header('Location: /error_page.php');
        $id = $_GET['id'];
     ?>
    

    And link to each other as follows:

    <a href="customer_system.php?id=<?=$id?>" class=" topitem">
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分