Detecting incoming URL

ChrisTERiS
ChrisTERiS used Ask the Experts™
on
Example: I'm on the file category.php where there is a link to article.php. Ofcourse when the uers clicks on the link is redirecting to article.php. The question is: What code I need to add in article.php to capture the incoming url (in this case category.php)?
$_SERVER['REQUEST_URI']  is giving article.php and not category.php
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
2nd Line Engineer
Commented:
something like this :

<?php

  session_start();

  if (!isset($_SESSION["origURL"]))
    $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];

?>

Author

Commented:
Fantastic. Actually I didn't used session, but rather I stored it in a variable eg:
$inboundurl = $_SERVER["HTTP_REFERER"];
and works fine.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial