I have tags for each id on page flinstones.php (tags can be in different orders)
$tag_array example:
id 123 = wilma, fred, bam bam, dinosaur
id 124 = dinosaur, bam bam, fred, wilma
var_dump($tags_array) returns this:
array(4) {
[0]=> string(5) "wilma"
[1]=> string(4) "fred"
[2]=> string(7) "bam bam"
[3]=> string(8) "dinosaur"
}
Now everything is as it should be. I’m using the first tag in a link parameter like so:
<a href="pandorum?tag=$tag1">$tag1</a>
Problem happens when I come back to this same page with a variable in the link.
flinstones.php?tag=fred
Now my var_dump($tags_array) gives me this instead of all the values above.
array(1) {
[0]=> string(4) "fred"
}
This changes my $tag1 to fred instead of wilma for id 123 and fred instead of dinosaur for id 124.
Is there a way to call that original *first tag* for the id?
flinstones.php flinstones.php?tag=fred
id 123 = *wilma*, fred, bam bam, dinosaur id 123 = fred (should be wilma)
id 124 = *dinosaur*, bam bam, fred, wilma id 124 = fred (should be dinosaur)
Check if
register_globalsis enabled. If they are, then you are clobbering the GET variable with your local version (so use a different variable in your code).Here is a link: http://www.php.net/manual/en/ini.core.php#ini.register-globals
(I remember when they flipped the default from on to off — it was a PITA to go back and fix code)