Report this

What is the reason for this report?

LAMP $_POST doesnt work or is empty

Posted on December 28, 2014

Hi, I have a Droplet with the application LAMP. My big problem is that I can’t get any data from POST.

<html>
<body>

Welcome <?php echo $_POST["name"]; ?><br>

</body>
</html>

Returns only "Welcome " with this link: X.X.X.X\page.php?name=test

Do you have any Idea? I tried to set up LAMP on my own and this also didn’t work.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

To the access the URL’s query string (name=test), you need to use $_GET instead of $_POST:

<html>
<body>

Welcome <?php echo $_GET["name"]; ?><br>

</body>
</html>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.