Well, since nothing's working I decided to copy the relevant parts of the aplication and see if you can try to help me again.
Thanks, rbauerle
config.php
<?
$url_stack = array();
// there are some defines here that are irrelevant to the problem
?>
lib.php
<?
function msSetBackLink($url)
{
global $url_stack;
$stack_size = count($url_stack);
if ($stack_size == 0){
array_push($url_stack,$url);
$stack_size++;
}
if ($url_stack[$stack_size-1] != $url){
array_push($url_stack,$url);
$stack_size++;
}
$link_pos = $stack_size-2;
if ($link_pos >= 0){
return "<br><a href='".$url_stack[$link_pos]."'><< Voltar</a><br>";
}else
return "";
}
?>
page.php
<?
include_once "config.php";
include_once "lib.php";
if ($HTTP_SERVER_VARS["argv"])
$url = msGetCurrentPage($HTTP_SERVER_VARS["SCRIPT_NAME"],$HTTP_SERVER_VARS["argv"]);
else
$url = msGetCurrentPage($HTTP_SERVER_VARS["SCRIPT_NAME"],""

;
echo "esta é a url 'pegada' da página atual: ".$url;
echo msSetBackLink($url);
?>