Reputation: 735
I have code which passes php variable to another page on my site:
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>';
I am able to retrieve the php variable $imageid by the following:
$imageid = htmlentities($_GET['imageid']);
I want to also pass in this code the value of a javascript variable. The variable is set in an earlier part of the code as follows:
var rowcount
I don't know how to pass var rowcount in the same echo code as I pass $imageid. What is the code to do this?
Upvotes: 0
Views: 432
Reputation: 26
How bout following:
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>";
Upvotes: 1