在页面之间传递参数值

时间:2018-05-22 02:52:35

标签: javascript php jquery

任何人都会帮助我,因为我不知道如何编码。我试过但它不起作用。

enter image description here

 function addRowHandlers() {
 var tbody = $("#employee-click"); //document.getElementById("employee- 
 click");
 tbody.each(function() {
 $(this).on('click', function() {     

      var passthis = $(this).find("#employee-grid").html();

   $.post("detail.php",

          {sessionval: passthis},

    function(e) { window.location.href ="detail.php?no="+passthis;}

   );

   })
  })
  }

对于php代码就是这样,它位于名为detail.php的不同页面中

   <?php


   if (isset($_GET['no']))
   $no= $_GET['no'];

   else
   $no = 0;

    include 'dbconnect.php';

    $query = "SELECT no,svcno,pangkat,name
    FROM av
     WHERE no = $no";

      $result = mysql_query($query) or die('SQL error');
      $row = mysql_fetch_array($result, MYSQL_ASSOC)

     ?>

如何使用php代码显示详细值的参数值,以便没有错误?请指导我。我已经重做了很长时间的代码,但还没有找到解决方案。

2 个答案:

答案 0 :(得分:0)

您可以尝试以下修改版本。代码将单击处理程序绑定到所有行。单击该行时,页面将重定向到detail.php页面,其中包含有效的sudo dpkg -i --force-downgrade \*3.6.5\* 参数值。

no

https://datatables.net/examples/advanced_init/events_live.html

答案 1 :(得分:0)

使用data-table获取行ID,点击下面的代码,这只是示例

带数据表的代码:

$(document).on('click', '#closingDatesTable tbody tr', function() {
 var row_id = $(this).attr('id');
 window.location.href = "detail.php?no=" + row_id;
});