<?php session_start(); if(isset($_SESSION['ref']) && !empty($_SESSION['ref'])) { if(preg_match("/pagina200/",$referer)) echo "se pare ca a venit de pe pagina 200"; elseif(preg_match("/pagina100/",$referer)) echo "se pare ca a venit de pe pagina 100"; } else echo "se pare ca a venit din padure"; $_SESSION['ref'] = $_SERVER['REQUEST_URI']; ?> Prima solutie ce mi-a venit in cap //Modificare: Problema e, din cate imi aduc eu aminte, ca "HTTP_REFERER" nu este trimis de toate cotrobaitoarele de internet, deci nu este bine sa-l folosesti. //Modificare2: Am gasit si pe http://php.net/manual/en/reserved.variables.server.php , "The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted." Deci, cum ziceam, mai bine nu-l folosesti.