1
chillbill
XOOPS navigation
  • 2005/3/10 10:59

  • chillbill

  • Just popping in

  • Posts: 5

  • Since: 2005/2/11


hi folks,

i started developting a database application using the xoops-framework with PEAR and MySQL within the XOOPS-mypage-module.

things worked fine until i run into this problem: imagine you have to views on a content namely A.php and B.php, which are calling a detail page C.php for editing. when editing is done C shall return to it's caller, which could be A or B.

how can i relize such a behaviour? i've already tried a session-stack approach without to much success, since XOOPS seems to kill my variables.

any usefull piece of advice is more than welcome...

desperately

chillbill

2
Mithrandir
Re: XOOPS navigation

XOOPS doesn't kill variables, so could you be a little more specific on what your approach is?

Add a variable in the URL could perhaps be another approach?

3
chillbill
Re: XOOPS navigation
  • 2005/3/10 19:43

  • chillbill

  • Just popping in

  • Posts: 5

  • Since: 2005/2/11


sorry, for beeing that general. here is the piece of code i'd like to use:

if(!session_id()){
session_start();
}

if (!isset($_SESSION['stack'])) {
$stack = array();
$_SESSION['stack'] = $stack;
}

function push($src) {
$stack = $_SESSION['stack'];
$stack[] = $src;
$_SESSION['stack'] = $stack;
}

function pop() {
return array_pop($_SESSION['stack']);
}

if (!isset($_SESSION['previous'])) {
echo "no prev
";
}
if (!isset($_SESSION['current'])) {
echo "no curr
";
}

echo "PREV:" . $_SESSION['previous'] . "
";
echo "CURR:" . $_SESSION['current'] . "
";

$_SESSION['previous'] = (string) $_SESSION['current'];
$_SESSION['current'] = (string) $_SERVER['PHP_SELF'] . ($_SERVER['QUERY_STRING'] ? "?" . $_SERVER['QUERY_STRING'] : "");

if ($_SESSION['current'] == $_SESSION['previous']) {
echo "POP
";
pop();
$_SESSION['previous'] = end($_SESSION['stack']);
} else {
echo "PUSH
";
push($_SESSION['previous']);
}
?>

this file shall be inlcuded in every page. but while debugging this, the session variables where gone till the next page was displayed.

thanx!

alex

Login

Who's Online

132 user(s) are online (111 user(s) are browsing Support Forums)


Members: 1


Guests: 131


heyula,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits