I integrated PHP 8.1.8 for Windows (php-cgi.exe) into a web application via a PHP handler (Iw::Content::Base::TContentBase) using TIWCGIRunner.
It works very well, almost all PHP examples from w3cschools.com can be run without any problems.
However, no PHP forms can be executed with POST, the following message is always output: "Warning: Undefined array key".
The form parameters are obviously not stored in the superglobals $_POST or $_REQUEST during POST.
I couldn't find any problem in the PHP configuration file, so I suspect a problem with the data transfer from TIWCGIRunner to php-cgi.exe.
Here are the contents of the two PHP files
FormPost.php:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="application/x-www-form-urlencoded">
</head>
<body>
<form method="post" action="FormPostDisplay.php">
<input type="text" name="name" value="Value POST">
<input type="submit">
</form>
</body>
</html>
FormPostDisplay.php:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p>Name: <?php echo $_POST['name']; ?></p>
<p>Name: <?php echo $_REQUEST['name']; ?></p>
</body>
</html>
An example would be available too.
Regards Juergen
It works very well, almost all PHP examples from w3cschools.com can be run without any problems.
However, no PHP forms can be executed with POST, the following message is always output: "Warning: Undefined array key".
The form parameters are obviously not stored in the superglobals $_POST or $_REQUEST during POST.
I couldn't find any problem in the PHP configuration file, so I suspect a problem with the data transfer from TIWCGIRunner to php-cgi.exe.
Here are the contents of the two PHP files
FormPost.php:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="application/x-www-form-urlencoded">
</head>
<body>
<form method="post" action="FormPostDisplay.php">
<input type="text" name="name" value="Value POST">
<input type="submit">
</form>
</body>
</html>
FormPostDisplay.php:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p>Name: <?php echo $_POST['name']; ?></p>
<p>Name: <?php echo $_REQUEST['name']; ?></p>
</body>
</html>
An example would be available too.
Regards Juergen