I'd liek to add "back" link and am trying to steer clear from JavaScript. Is there something in PHP that'll work well?
you could use $_SERVER['HTTP_REFERER'] though it's not very reliable.
Yes, however it cannot be trusted to work.
if (isset($_SERVER['HTTP_REFERER'])) { //use $_SERVER['HTTP_REFERER'] as the link } else { //they may have come somewhere however its not set from the browser }
In planetsim's example, you could use the BACK link if the referer was sent, and a simple HOME link if it wasn't.