• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question $_POST and $_GET not always available

Koen Verbruggen

Basic Pleskian
Dear Plesk gurus,

Given the following hypothetical setup in page.php
Code:
<form action="page.php?id=3">
 <input type="text" name="somevar" value="hello" />
</form>

I would expect to reload page.php with:
$_GET['id'] en $_POST['somevar'] being set
However I only receive $_GET['id'].
I used to get them both on another server (apache only).

I bypassed this by providing the id var in $_POST but then something else happens:
seems $_POST vars are only provided when I submit to the full URL:
action="https://example.com/page.php"
and are not available when using:
action="page.php" (however page.php is loaded but not with $_POST).


What am I missing here?
Hope one of you understands what's happening.

Regards.

(PHP version 5.6.32, default Plesk Nginx and Apache settings)
 
Back
Top