|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 */ ?> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
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