How to get the current browser URL with PHP?

0

For example, I have the following URL generated with ngRoute of AngularJS : https://www.projeto.com/edit/25 , 25 is the ID, I need to get this ID in PHP.

In searches, I found the following solution to get the URL in PHP:

$url = $_SERVER[REQUEST_URI]

But the problem is that it returns the wrong URL, returns https://www.projeto.com/edita.php instead of the URL generated by the angle ( https://www.projeto.com/edit/25 ).

  

Is there any way to get the current browser URL in php?

    
asked by anonymous 31.05.2017 / 15:57

1 answer

0

Use the $ _SERVER ['HTTP_REFERER'] attribute, it will refer to the source link of the request.

    
31.05.2017 / 16:06