location.href传递变量

时间:2013-09-20 03:54:18

标签: php variables

是否可以使用onclick="location.href"

在PHP中传递变量 像pref一样

echo "<a href='reply1.php?r_username=".$rows['comment']."&prod_id=".$row['prod_id']."'     class='reply_button'> REPLY </a>  ";

1 个答案:

答案 0 :(得分:2)

将此示例用于您的解决方案

   window.location.href = "myphpfile.php?one=" + one + "&two=" + two;

如果你想要ajax请求:

    $.ajax({
       url: "myphpfile.php",
       method: 'get',
       data : {one:"one",two:"two"},
      success:function() {
      alert("hi to all");
      });