php - pass link text to next page -
for actual web-project, made tagcloud. when click on tag, should passed page showrecipesfromtags.php
.
<form name="tagform" id="tagform" method="get" action="/showrecipesfromtags.php"> <?php include('php/getrandomtags.php'); $tagsarr = json_decode($return4634, true); foreach ($tagsarr['data']['tag'] $key => $tag11) { echo '<a id="seastags" href="#" onclick="document.tagform.submit()"><font size="' . rand(1,4) .'">' . $tag11['tag_name'] . '</font> <br/></a> '; } ?> </form>
it can go page clicking on href, need pass id of clicked tag. name of tag called tag_name
. name shown don´t know how pass id next site. id in json array , called tag_id
.
how can manage this?
why need form? use plain links. try using in foreach
loop:
echo '<a id="seastags" href="/showrecipesfromtags.php?tagid=' .$tag11['tag_id'] . '"><font size="' . rand(1,4) .'">' . $tag11['tag_name'] . '</font> <br/></a> ';
Comments
Post a Comment