yandeu / five-server

⚡ Development Server with Live Reload Capability. (Maintained Fork of Live Server)
https://www.npmjs.com/package/five-server
Other
165 stars 14 forks source link

form action="index.php" method="GET" prompts to download page? #58

Closed ghost closed 2 years ago

ghost commented 2 years ago

index.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
    <form action="index.php" method="GET">
        <input type="text" name="test">
        <input type="submit">
    </form>

    <?php
    if (isset($_GET["test"])) {
        echo "test";
    }
    ?>

</body>
</html>

Pressing the submit button in the form prompts you to download the page. Although in nginx it echoes "test" like normal.

PHP version: 8.0.18 Five server version: 0.1.4

yandeu commented 2 years ago

Five-Server does render PHP, but it does not include a PHP Server.

Please see https://github.com/yandeu/five-server-vscode#about-php

ghost commented 2 years ago

Five-Server does render PHP, but it does not include a PHP Server.

Please see https://github.com/yandeu/five-server-vscode#about-php

Cloned this and followed all the instructions https://github.com/yandeu/five-server-with-php

Same behavior with

<form action="index.php" method="GET">
    <input type="text" name="test">
    <input type="submit">
</form>
ghost commented 2 years ago

Also localhost:8000 doesn't show anything, had to open localhost:5500 to open the page

yandeu commented 2 years ago

Hmm. You should be able to access the php server on port 8000.

Yes, if you go to 5500, it's the same as not using a PHP server.