Maximus Posted March 12, 2007 Share Posted March 12, 2007 I am trying to get the current page's filename, it can be gotten with "$_SERVER['PHP_SELF']". However that only tells you the filename (test.php) and not the actual variables added onto it (test.php?page=3). Can someone help me? Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/ Share on other sites More sharing options...
JasonLewis Posted March 12, 2007 Share Posted March 12, 2007 $_SERVER['REQUEST_URI']; maybe? Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/#findComment-205214 Share on other sites More sharing options...
Maximus Posted March 12, 2007 Author Share Posted March 12, 2007 Aha, that works! However, it also adds "&1173764234422" to the end of each url, which I belive is the unix timestamp. I guess I could remove that, but lets see if there is a better method. Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/#findComment-205231 Share on other sites More sharing options...
JasonLewis Posted March 12, 2007 Share Posted March 12, 2007 thats odd, it doesnt add that for me. Unless that is already in your url? Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/#findComment-205233 Share on other sites More sharing options...
Maximus Posted March 12, 2007 Author Share Posted March 12, 2007 it isen't. Maybe its the server configuration. Oh well, it'll do, thanks! Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/#findComment-205236 Share on other sites More sharing options...
Demonic Posted March 12, 2007 Share Posted March 12, 2007 um: $link = $_SERVER['REQUEST_URI']; $link = str_replace("&1173764234422","",$link); Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/#findComment-205237 Share on other sites More sharing options...
JasonLewis Posted March 12, 2007 Share Posted March 12, 2007 yeh but if its the timestamp then it wont be the same. you could just do that except with time(). Link to comment https://forums.phpfreaks.com/topic/42302-get-current-filename-along-with-vars/#findComment-205286 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.