I've been trying to use a button as a link to add some interactivity to my site, however for some reason it doesn't work.
I've been using this code for a search bar:
<span>
<input type="text" id="search" placeholder="Zoek naar een boek of auteur" name="search" method="get" autocomplete="off" style="width:25%;" value="<?php echo htmlspecialchars($search); ?>"></input>
<button type='submit' style="vertical-align:middle" id='filterButton' onclick="<?php echo htmlspecialchars("'?search=$_GET[search]'");?>">
<span>Zoek</span>
</button>
</span>
This works perfectly fine, when I click the button, I go to the search page with the variable. In the search results, I use the same method to make a "more info" button, redirecting the user to a page with, well, more information about a book. This is the code in this part
<span>
<button type='submit' style="vertical-align:middle" id='infoButton' onclick="<?php echo htmlspecialchars("book.phph?id=$resultsid");?>">
<span>Meer info</span>
</button>
</span>
But this doesn't work, the button does respond when I click it (I get the animation), but I don't get redirected to the page. I've tried a different method:
<span>
<form action="<?php echo htmlspecialchars('book.php?id=$resultsid');?>">
<button type='submit' style="vertical-align:middle" id='infoButton' />
<span>Meer info</span>
</button>
</form>
</span>
This redirects me to "book.php?", but that's it. It ignored the id=$resultsid behinf the question mark. I can't get it to work, can somebody help please?
Thanks ~DagelijksGamer