I have a list of href items as shown below:
<header class="less-header" role="banner">
<h1><a href="#">Grid Options</h1>
<ul>
<li><a href="test.php?user=SORTENDDATE">SORT by END DATE</span></a></li>
<li><a href="test.php?user=SORTSTARTDATE">SORT by START DATE</span></a></li>
<li><a href="test.php?user=SORTZA">SORT Z to A</span></a></li>
<li><a href="test.php?user=SORTAZ">SORT A to Z</span></a></li>
</ul>
</header>
Now I want to add a variable also to the href string so that it becomes:
<?php
$Custom = "APPS";
?>
<header class="less-header" role="banner">
<h1><a href="#">Grid Options</h1>
<ul>
<li><a href="test.php?user=SORTENDDATE&($Custom)">SORT by END DATE</span></a></li>
<li><a href="test.php?user=SORTSTARTDATE">SORT by START DATE</span></a></li>
<li><a href="test.php?user=SORTZA">SORT Z to A</span></a></li>
<li><a href="test.php?user=SORTAZ&($Custom)">SORT A to Z</span></a></li>
</ul>
</header>
How to append href strings with variables in html using php?
I tried this much:
($Custom)automatically to it or do u mean that u tried the 2nd example and it didn't work ?