Do you have any questions about php?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
<body>
<a href="fr.php?action=123">123</a>
</body>

<?php
class abc{
    function __construct($action)
    {
        if (isset($_GET["action"])){}
        echo $_GET["action"];
    }
}

new abc("fr.php");
?>
</head>
</html>

Why can $_ _ GET ["action"]
be allowed after the parameter fr.php is passed in? I don"t know much about the process.

Php
Mar.04,2021

.
it's you again.
see ? action= No

clipboard.png


first send the request to the web server, assuming it is nginx.
then, nginx will send the request link to a cgi interpreter of php-fpm, and nginx will encapsulate all http request data such as request method, cookie,header, parameters and so on into a certain format to cgi.
and each language has its own syntax for getting this data, and the syntax of php is to get the parameter data of the get request through the _ _ $GET global variable. For more information, please follow the official account of nginx.


function _ _ construct ($action) {}
the $action passed in by you is not used in the method?
so this parameter is the same as yes or no.
but the parameter is already set in your _ _ construct () constructor,
so you must pass in the parameter when you instantiate the class. After the
sentence: parameters are required, but the value you get has nothing to do with the parameters you pass in.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5aefb-44317.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5aefb-44317.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?