Why can _ GET get a _ POST request?

$_ GET gets the data requested by get
$_ POST gets the data requested by post

the following example

<html>
    <body>
    <?
        $flag = $_GET["flag"];
        if($flag=="1")
            echo "".$_POST["user"]."";
        else
            echo  " 
            <form action="?flag=1" method="post">
                :<input type="text" name="user" size=15>
                <input type="submit" value="submit">
            </form>";
    ?>
</body>
</html>

the first time to open this page is a form
fill in the name, click submit, using the post method, why can $_ GET ["flag"] get the value of flag?

I don"t quite understand how it works.
is the data here transmitted in post or get mode? Or have you passed it both ways?

Php
Apr.05,2021
The key point of

is that such url "? flag=1" is used in post. The result is that flag is passed to the background as a get parameter, so the background can fetch both the flag in the $_ GET parameter and the other form parameters in the $_ POST parameter.

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-1b36b2b-2c02a.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-1b36b2b-2c02a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?