php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24240 Form data not passed to CGI scripts
Submitted: 2003-06-18 00:26 UTC Modified: 2003-06-18 22:36 UTC
From: mcratt at itctel dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.3.2 OS: RedHat Linux 2.4.18-3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mcratt at itctel dot com
New email:
PHP Version: OS:

 

 [2003-06-18 00:26 UTC] mcratt at itctel dot com
Description:
------------
Using PHP 4.3.2 CGI:

Data entered in an HTML form is not being passed to CGI script. The following methods are affected:
$HTTP_POST_VARS, $HTTP_GET_VARS, $_POST, $_GET and using the variable names as they appear in the HTML form.

Register Globals => ON

OS: RedHat Linux 2.4.18-3
Apache Version: 1.3.27
Configure Command =>  './configure' '--prefix=/usr/local' '--with-apache=../../apache_1.3.27' '--enable-exif' '--enable-track-vars' '--with-calendar=shared' '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--enable-inline-optimization' '--enable-memory-limit' '--with-gd=/usr/local' '--with-zlib' '--enable-gd-native-tt' '--with-t1lib=/usr/local' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-ttf' '--with-freetype-dir=/usr/local' '--with-mhash=/usr/local' '--with-mcrypt=/usr/local' '--with-pdflib=/usr/local' '--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-zlib-dir=/usr' '--with-openssl=/usr' '--with-curl=/usr' '--with-ldap'

Reproduce code:
---------------
HTML form:
<form name="the_form" action="some.cgi" method="post"> // or method="get"
<input type="text" name="var01">
<input type="text" name="var02">
<input type="submit" value="Submit">
</form>

some.cgi:
#!/usr/bin/php
<?php
$var01 = $_POST['var01']; // or $var01 = $_GET['var01'], etc.
$var02 = $_POST['var02'}; // or $var02 = $_GET['var02'], etc.
echo "Content-type: text/html\n\n";
echo "var01 = $var01 and var02 = $var02.";
?>

Expected result:
----------------
var01 = <somevalue> and var02 = <anothervalue>.

Actual result:
--------------
var01 = and var02 =.

$_SERVER and $_ENV will contain the correct query string using get.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-18 13:09 UTC] sniper@php.net
Misconfigured system. Works fine here with properly configured Apache.

 [2003-06-18 22:36 UTC] mcratt at itctel dot com
My apologies to the PHP team. There is always one more thing to check before something is really a bug. As sniper guessed in my other bug report, apache was pointing to the CLI and not the CGI binary.

Thank you for your time and efforts.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC