This is the situation:
I added a link by drupal l() function in file common.php, function link_page():

$links[] = l(t("new link1"), array("var1" => "1"), "index", "", "");

What have I to do if:

I want this link to detect what page was loaded and refer to the last node(module, index) that was loaded, I mean, the link must refer to the same page, just to pass variable var1 ?

AND THE OTHER PROBLEM:

By drupal l() function in file common.php, function link_page() I added two such links:

$links[] = l(t("new link1"), array("myvar" => "1"), "index", "", "");
$links[] = l(t("new link2"), array("myvar" => "2"), "index", "", "");

in node.module in function node_load() I wrote

echo "myvar: ".$myvar."
";

So now I can see the meaning of variable $myvar after clicking on new link1 or new link2

What happens:
1. I click new link1
the result: myvar=1
2. I click new link2
the result: myvar=1 /// STILL 1 THOUGH THERE MUST BE 2!!!
3. I reload webpage
the result: myvar=2

What to do to get myvar=2 just clicking one time on new link2???

Comments

scurry’s picture

I've found the decision