<?php function set_return_point($returnurl=null,$autodeduce=true) { if (!$returnurl && $autodeduce) $returnurl=TGET('returnurl'); if ($returnurl) { $_SESSION['return_point_url']=$returnurl; $parts=parseURL($_SERVER['REQUEST_URI']); parse_str($parts['query'],$queryparts); unset($queryparts['returnurl']); $query=http_build_query($queryparts); header("Location: ".$parts['path'].($query?'?'.$query:'').($parts['fragment']?'#'.$parts['fragment']:'')); return true; } return false; } function get_return_point() { return @$_SESSION['return_point_url']; } function goto_return_point($url=null) { if (!$url) { if ($_SESSION['return_point_url']) { $url=$_SESSION['return_point_url']; unset($_SESSION['return_point_url']); $url.=strpos($url,'?')===false?'?':'&'; $url.='RESETSESSID='.urlencode(session_id()); } else $url='./'; } header('Location: '.$url); } ?>