php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23401 $_POST, $_GET empty
Submitted: 2003-04-29 03:47 UTC Modified: 2003-06-02 06:33 UTC
From: marten dot wibom at seb dot se Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.3.2RC2 OS: sun solaris 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marten dot wibom at seb dot se
New email:
PHP Version: OS:

 

 [2003-04-29 03:47 UTC] marten dot wibom at seb dot se
i'm having trouble with $_POST, $_GET superglobals...as well with $HTTP_POST_VARS and $HTTP_GET_VARS. they're empty, not even initialized. from what i can see is that $_SERVER is the only superglobal working, for example GET information is stored in $_SERVER[QUERY_STRING].

i've tested 4.3.2-RC2, 4.3.2-RC1, 4.3.1 and 4.2.2 with no difference. configured with "--with-oracle=... --with-oci8=... --with-apxs=...".

i use apache 1.3.27 on sun solaris 7.

i use a testscript last in this mail that get theese results:
http://www.teamless.com/seb/result-post.txt
http://www.teamless.com/seb/result-get.txt

with theese configurations:
http://www.teamless.com/seb/httpd.conf
http://www.teamless.com/seb/php.ini


thank you for your help!


---testscript---
#!/usr/local/bin/php
<?php

html_header(); /* Content-type: plain/html */
html_start(); /* html header */

phpinfo();

$new_action = $_GET["action"];
$new_test = $_POST["test"];
$new_srv = $_SERVER['SERVER_NAME'];
$old_test = $HTTP_POST_VARS["test"];
$old_action = $HTTP_GET_VARS["action"];
$req_action = $_REQUEST["action"];
$req_test = $_REQUEST["test"];

$dir_test = $test;

$meth = $_SERVER['REQUEST_METHOD'];

import_request_variables( "gP", "imp_" );


print( "new_action=$new_action<BR>\n" );
print( "new_test=$new_test<BR>\n" );
print( "new_srv=$new_srv<BR>\n" );
print( "old_action=$old_action<BR>\n" );
print( "old_text=$old_test<BR>\n" );
print( "req_action=$req_action<BR>\n" );
print( "req_test=$req_test<BR>\n" );
print( "action=$action<BR>\n" );
print( "dir_test=$test<BR>\n" );
print( "imp_action=$imp_action<BR>\n" );
print( "imp_text=$imp_test<BR>\n" );
print( "method=$meth<BR>\n" );
print( "raw=$HTTP_RAW_POST_VARS<BR>" );

print( "argc=$_SERVER[QUERY_STRING]<BR>" );
print( "argc=$_SERVER[DOCUMENT_ROOT]<BR>" );
print( "argc=$_SERVER[SERVER_NAME]<BR>" );

print_r( $_POST );
print( "<BR>" );

?>
<FORM METHOD="post" ACTION="www_resources.php">
test:<INPUT TYPE="text" NAME="test" VALUE="testtext" SIZE="60">
<INPUT TYPE="submit" NAME="go" VALUE="Test it!">
</FORM>
<FORM METHOD="get" ACTION="www_resources.php">
test:<INPUT TYPE="text" NAME="test" VALUE="testtext" SIZE="60">
<INPUT TYPE="submit" NAME="go" VALUE="Test it!">
</FORM>
<?php

print( "<A HREF=\"www_resources.php?action=mupp&test=blupp\">Link</A>" );

html_stop(); /* html footer */
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-29 10:37 UTC] sniper@php.net
Either use CGI or use the module, but don't combine them.
And you're propably doing something else wrong too, as
this works just fine here.

 [2003-05-06 05:48 UTC] marten dot wibom at seb dot se
i had CGI for testing, which turned out not to work either. it's now removed again with no difference.

yes, the testscript runs fine elsewhere, for example on the webhotel i'm using.

i've seen discussions about solaris7 and apache1.3 having problems with libexpat. my apache comes from www.sunfreeware.com, a cannot compile it myself since it's complaining about libexpat. but i haven't seen a solution for it somewhere..

could libexpat create this type of problems?
 [2003-06-01 22:34 UTC] jullrich at euclidian dot com
I am experiencing the same problem, and don't think this should be marked 'bogus'. In my case, while I use php_mod
for apache, I do use the cgi version for shell script. Due to old pre-cli code, I can't easily switch to cli.

Simple sample:
> export QUERY_STRING='x=1'
> php
<? 
echo "x $x\n";
echo "request[x] $_REQUEST[x]\n";
echo "query string $_ENV[QUERY_STRING]\n";
?>

returns:
----------------------------------------
Content-type: text/html
X-Powered-By: PHP/4.3.2
 
x
request[x]
query string x=1

---------------------------------------

just to confirm that I am using cgi:

php -v
PHP 4.3.2 (cgi), Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
    with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC