$dadove = $_SERVER['HTTP_REFERER'];

if ($dadove == 'index.html')
{ eccetera