What am i dpoing wrong?

can someone look at this and tell me? My php never executes when i push the button but if i add code to detect the ‘GET’ method i see the page load request. Help!!!



post <?php if ($_SERVER["REQUEST_METHOD"] == "GET") { echo "
... caught GET"; } if ($_SERVER["REQUEST_METHOD"] == "POST") { echo "
... caught POST"; echo "
...srvr.post=:" . $_POST; } ?>

Try this:

if ($_SERVER["REQUEST_METHOD"] === "GET") {
    echo "... caught GET";
}

if ($_SERVER["REQUEST_METHOD"] === "POST") {
    echo "... caught POST";
    echo "...srvr.post=:";
    var_dump($_POST);
}

Earlier, you tried to concatenate an array ($_POST), which is an error in PHP. Other than that, if you cannot catch POST, you are not sending a POST request.

If you are testing your website and sending requests, try a client like Postman:
https://www.postman.com/