How to display URL parameters in PHP script?

I want to redirect my browser to a PHP page so that when the page loads, it displays to the user a substring of the current URL.

For example, let's say I have a page called substring.php.

My browser redirects me to:

http://www.example.com/substring.php?oauth_token=123456

Is it possible to write some PHP code that will be displayed to the user, "123456"?

If so, can someone help me on how to do this?

Thank!

+3
source share
4 answers
<?php
  echo $_GET['oauth_token'];
?>
+3
source

URL- $_GET, :

echo $_GET['oauth_token'];

, , URL- (.. ), , . htmlspecialchars() :

echo htmlspecialchars($_GET['oauth_token']);
+4

$_GET? URI :

echo $_GET['oauth_token'];
+2

oauth_token $_GET:

echo $_GET['oauth_token'];

, , , , .

+2

Source: https://habr.com/ru/post/1729832/


All Articles