Adam93 Posted September 7, 2014 Share Posted September 7, 2014 Hi, Just wondering if it's possible to get the dynamic part of the URL with the GET method? I'm getting the address of the URL to add to a database when a user reports an error on that page; <?php $actual_link = $_SERVER['PHP_SELF'];?> But I've noticed the if the url is for example "profile.php?username=someone" then it is only getting "profile.php". Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted September 7, 2014 Share Posted September 7, 2014 Then check if $_GET or $_GET['name'] is set to the url and add the value of this variable to the log file. Quote Link to comment Share on other sites More sharing options...
Solution mac_gyver Posted September 7, 2014 Solution Share Posted September 7, 2014 $_SERVER["REQUEST_URI"] contains the path/file and also includes the url query string. Quote Link to comment Share on other sites More sharing options...
Adam93 Posted September 7, 2014 Author Share Posted September 7, 2014 $_SERVER["REQUEST_URI"] contains the path/file and also includes the url query string. Thank you! :-) 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.