son Posted October 2, 2009 Report Share Posted October 2, 2009 I am working on a 'Continue shopping' link and have the following code: $_SESSION['back'] = $_SERVER['PHP_SELF'];if (isset($_SESSION['back']) && $_SESSION['back'] != '') { $backlink = $_SESSION['back']; } else { $backlink = 'index.php'; } echo "<a href=\"" . $backlink . "\" title=\"Continue Shopping\"><INPUT type=\"submit\" value=\"Continue Shopping\" id=\"continue\" name=\"continue\"></a> "; It works for pages that do not contain any query string (item.php?pid=8&cid=10 for example), but for those with query string it does not. Is there an alternative to $_SERVER['PHP_SELF'] which includes querystring?SonSon Link to comment Share on other sites More sharing options...
Synook Posted October 2, 2009 Report Share Posted October 2, 2009 http://www.php.net/reserved.variables.serverTry $_SERVER['REQUEST_URI']. Link to comment Share on other sites More sharing options...
son Posted October 2, 2009 Author Report Share Posted October 2, 2009 http://www.php.net/reserved.variables.serverTry $_SERVER['REQUEST_URI'].Synook,Many thanks. This does the trick (also learned something new which is always good;-))!Son Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now