[英]Echo Javascript Variable in Php to another page
我有將php變量傳遞到我網站上另一頁的代碼:
echo'<a class="btn btn-danger" style="margin-left:10px;width:120px;float:left;" href="fullsizemarket.php?imageid=',$imageid,'&action=removed">Remove from Cart</a>';
我可以通過以下方式檢索php變量$ imageid:
$imageid = htmlentities($_GET['imageid']);
我還想在此代碼中傳遞javascript變量的值。 該變量在代碼的前面部分中進行了如下設置:
var rowcount
我不知道如何在傳遞$ imageid的相同回顯代碼中傳遞var rowcount。 這樣做的代碼是什么?
如何追蹤:
echo
"<a class='btn btn-danger'
style='margin-left:10px;width:120px;float:left;'
href='fullsizemarket.php?imageid=$imageid&action=removed&rowcount='
onclick = \" this.setAttribute('href', this.getAttribute('href')+rowcount) \"
>Remove from Cart</a>";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.