weixin_33730836 2015-04-08 11:10 采纳率: 0%
浏览 24

携带表的行ID

i am fetching followers list from instagram in an array that is stored in a session and then displaying the data in a tabular form

<table class="tablesorter" cellspacing="0"> 
    <thead> 
        <tr> 
            <th></th>
            <th>User Name</th>
            <th>Name</th>
            <th>Profile Picture</th>
            <th>Add</th>                                    
        </tr> 
    </thead> 
    <?

        $followers=$_SESSION["followers"];
        foreach ($followers['data'] as $data) 
            {?>
                <tbody> 
                    <tr> 

                        <td></td>
                        <td><? echo $data['username']; ?></td>  
                        <td><? echo $data['full_name']; ?></td> 

                        <td><a target = '_blank' href="<? echo $data['profile_picture']; ?>"><img name="image" src="<? echo $data['profile_picture']; ?>" width="40" height="40" alt="word" /></a></td>

                        <td><a href="a_add_vendor.php"><input type='image' src='img/add.png' title='Add' style="height:20px; width:20px;"></a></td>
                    </tr> 
                </tbody> 
          <?}?>
</table>

i want that when the add button is clicked, the page should redirect to next page i.e a_add_vendor.php and also carry the values of that specific row to the next page. While dealing with database i could carry the id of that row something like this a_add_vendor.php?id=id, but here the data is not related to database so can anyone tell me how i can do so

  • 写回答

2条回答 默认 最新

  • weixin_33670786 2015-04-08 11:14
    关注

    What you could try is changing the href to

        <a href="a_add_vendor.php?id=<?php echo $data['id']?>&fullname=<?php echo $data['fullname']?> .... (or whatever which properties you want to pass on
    

    then in the PHP file :

        $id = $_GET['id'];
    
    评论

报告相同问题?

悬赏问题

  • ¥15 已知平面坐标系(非直角坐标系)内三个点的坐标,反求两坐标轴的夹角
  • ¥15 webots有问题,无响应
  • ¥15 数据量少可以用MK趋势分析吗
  • ¥15 使用VH6501干扰RTR位,CANoe上显示的错误帧不足32个就进入bus off快慢恢复,为什么?
  • ¥15 大智慧怎么编写一个选股程序
  • ¥100 python 调用 cgps 命令获取 实时位置信息
  • ¥15 两台交换机分别是trunk接口和access接口为何无法通信,通信过程是如何?
  • ¥15 C语言使用vscode编码错误
  • ¥15 用KSV5转成本时,如何不生成那笔中间凭证
  • ¥20 ensp怎么配置让PC1和PC2通讯上