I have code like this which is a button for a user to be redirected to the auction page for a specific item with a specific auction_id. The button is of type <button>
and I am trying to give it an onclick to redirect to:
http://192.168.33.10/productpage.php?q=12344
But instead my current code makes the page redirect to:
http://192.168.33.10/productpage.php?q=%3C?php%20echo%20$id;%20?%3E
Any ideas why? Code is below, I used solutions online but none help for the <button>
tag.
<td class="col-sm-1 col-md-1">
<?php
if ($_SESSION['role_id'] == 1 && $enddt > time()) {
$id = $bidauction['auction_id'];
echo '<button type="button" onclick="location.href=\'productpage.php?q=<?php echo $id; ?>\'" class="btn btn-success" style="margin-top:10px">
<span class="glyphicon glyphicon-hand-up"></span> Raise Bid
</button>';
}
?>
</td>