Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 PHP 在 PHP 中传递变量onclick="location.href"?
onclick="location.href"
像href一样
echo "<a href='reply1.php?r_username=".$rows['comment']."&prod_id=".$row['prod_id']."' class='reply_button'> REPLY </a> ";
将此示例用于您的解决方案
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"); });