Is it possible to submit two values from one button?
$orderby = $_GET['orderby'];
<form action="mypage.php" method="get">
<a><button name ="orderby" value="name" type="submit">▼</button></a>
<a><button name ="orderby" value="age" type="submit">▼</button></a>
</form>
I imagine something like this:
<a><button name ="orderby" value1="name" value2="ASC" type="submit">▼</button></a>
<a><button name ="orderby" value1="name" value2="DESC" type="submit">▼</button></a>
<a><button name ="orderby" value1="age" value2="ASC" type="submit">▼</button></a>
<a><button name ="orderby" value1="age" value2="DESC" type="submit">▼</button></a>
You can use a hidden field with <input type="hidden"/>
:
<?php
$orderby = $_GET['orderby'];
?>
<form action="mypage.php" method="get">
<input type="hidden" name="field" value="fieldname"/>
<input type="hidden" name="orderby" value="<?= $orderby ?>"/>
<button name ="submit" value="1" type="submit">▼</button>
</form>