Warptweet Posted March 19, 2007 Share Posted March 19, 2007 I would use this code to check what the current page is. $realname = basename($_SERVER[sCRIPT_FILENAME], ".php"); if ($realname == 'index.php?cmd=index') { do stuff } But, instead of the current page, any ideas how I would use that (it can be different if neccessary) to check if the PREVIOUS page was 'index.php?cmd=index'? Quote Link to comment Share on other sites More sharing options...
conker87 Posted March 19, 2007 Share Posted March 19, 2007 I would use this code to check what the current page is. $realname = basename($_SERVER[sCRIPT_FILENAME], ".php"); if ($realname == 'index.php?cmd=index') { do stuff } But, instead of the current page, any ideas how I would use that (it can be different if neccessary) to check if the PREVIOUS page was 'index.php?cmd=index'? Wouldn't $_SERVER['HTTP_REFERER']; work? $realname = basename($_SERVER['HTTP_REFERER'], ".php"); if ($realname == 'index.php?cmd=index') { do stuff } Quote Link to comment Share on other sites More sharing options...
Warptweet Posted March 19, 2007 Author Share Posted March 19, 2007 I hope so, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.