php - Additional elements to URLS? -


i'm not sure terminology is, have site uses "tag-it" system, can click on tags , takes user to

topics.php?tags=example 

my question sort of scripting or coding required able add additional links?

topics.php?tags=example&tags=example2 

or

topics.php?tags=example+example2 

here code in how site linked tags.

header("location: topics.php?tags={$t}"); 

or

<a href="topics.php?tags=<?php echo $fetch_name->tags; ?>"><?php echo strtolower($fetch_name->tags);?></a> 

thanks hints or tips.

you cannot pass tags 2 times parameter although can pass array

topics.php?tags[]=example&tags[]=example2 

assuming want try

$string = "topics.php?"; foreach($tags $t) {     $string .= "tag[]=$t&"; } $string = substr($string, 0, -1); 

we iterate through array concatenating value our $string. last line removes & symbol appear after last iteration

there option looks bit more dirty might better depending on needs

$string = "topics.php?tag[]=" . implode($tags, "&tag[]="); 

note make sure tags array not empty


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -