$_GET and $_POST not working

前端 未结 1 385
一生所求
一生所求 2021-01-23 04:37

I am a beginner in php and am trying some very simple tests to get started.

I seem to be unable to get any values from $_GET.

This test.php

#!/us         


        
相关标签:
1条回答
  • 2021-01-23 05:12

    The $_GET and $_POST variables are only available if track_vars is turned on.

    As of PHP version 4.0.3 that is always automatically enabled.

    Can you check your PHP version and also check the value of track_vars in php.ini?

    It would also be helpful if you check phpinfo();

    <?php
    phpinfo();
    ?>
    

    Check for

    • something called --enable-track-vars, which should be present.

    • _SERVER["argv"], should contain an array if you pass vars via a GET request.

    • also "Loaded Configuration File" should resolve to the file you think it is.

    source: PHP: Description of core php.ini directives

    0 讨论(0)
提交回复
热议问题