Hi all
I have a weird problem with passing varibles from snippets.
I've done this loads of times using something like:
mydomain.com/something.html?variable=somevalue
then to get the variable in a snippet I use GET:
$variable = isset($_GET['variable']) ? $_GET['variable'] : '';
This typically works fine, but now I have a page where the variable wont update.
I have a page, lets call it "list.html", populated with entries from a DB, and they are all ordered as links like this:
<a href="/something.html?VariableId=1">DB item 1</a>
<a href="/something.html?VariableId=2">DB item 2</a>
<a href="/something.html?VariableId=3">DB item 3</a>
Then at page "something.html" I have a snippet which uses the VariableId passed in the URL, like this:
$VariableId = isset($_GET['VariableId']) ? $_GET['VariableId'] : '';
echo $VariableId;
This works the first time, but when I enter "list.html" again and press another link, the echoed variable is the same as before.
Fx. If I press the link for DB item 1 the first time, the snippet at "something.html" will echo "1". When I return to "list.html" and press the link for DB item 2, the echoed value is still "1"
Am I missing something, or does anyone know why the variable does not seem to be updated to the proper value sent by the URL?
Thanks in advance for all answers