deserty Posted October 27, 2012 Report Share Posted October 27, 2012 Firefox vad nu accepta $_SERVER['HTTP_REFERER']; si nu-mi returneaza nimic.Ceva alternative ? Quote Link to comment Share on other sites More sharing options...
B7ackAnge7z Posted October 27, 2012 Report Share Posted October 27, 2012 Firefox vad nu accepta $_SERVER['HTTP_REFERER'];Probabil la ora asta to?i telepa?ii au mers la culcare. Totu?i, încearc? s? scrii mai detaliat ce dore?ti s? faci, ?i arat? câteva linii de cod.ps. Poate ai instalat vreun addon pentru Firefox ce blocheaz? trimiterea referer-ului. Quote Link to comment Share on other sites More sharing options...
deserty Posted October 27, 2012 Author Report Share Posted October 27, 2012 Exemplu :<?php$referer = $_SERVER['HTTP_REFERER']; if (preg_match("/pagina100/",$referer)) {echo "vizita a venit din pagina100"; }elseif (preg_match("/pagina200/",$referer)) {echo "vizita a venit din pagina200"; }else {echo "vizita fara referer"; }?>Pe chrome functioneaza perfect. Insa pe Mozilla nu.Testat pe mai multe calculatoare si la fel face. Quote Link to comment Share on other sites More sharing options...
BogdanNBV Posted October 27, 2012 Report Share Posted October 27, 2012 (edited) <?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. Edited October 27, 2012 by BogdanNBV Quote Link to comment Share on other sites More sharing options...
B7ackAnge7z Posted October 27, 2012 Report Share Posted October 27, 2012 E gre?it s? consideri c? "vizita e f?r? referer" dac? nu a venit de pe pagina 100 sau 200.Încearc? print_r($_SERVER['HTTP_REFERER']); s? vezi ce prime?ti.ps. Întâmplator cu Chrome nu intri de pe /pagina100, dar cu Firefox de pe /pagina101? Quote Link to comment Share on other sites More sharing options...
deserty Posted October 27, 2012 Author Report Share Posted October 27, 2012 Mda ... m-am lamurit cu $_server['http_referer'];Vroiam sa fac ceva simplu, mergea totul perfect pe chrome, dar ie si mozilla sucks si nici nu e safe.Mc de raspunsuri. Am rezolvat cu sesiuni. Quote Link to comment Share on other sites More sharing options...