php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28911 $_Get and $_Post not avaible
Submitted: 2004-06-24 14:52 UTC Modified: 2004-07-19 20:26 UTC
From: kae at aals dot ch Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.7 OS: windows XP Workstation
Private report: No CVE-ID: None
 [2004-06-24 14:52 UTC] kae at aals dot ch
Description:
------------
Hello,
I've installed the IIS 5.1, Windows xp, PHP 4.3.7 exsatly how the instruction in infos24.de and installmanual (PHP).
Now when i load a form and make an input, then with a button on this form call the next form (form2), in this form i want display $_post or $_get and no value is on the variable.

PHP.ini global_registers = off

When i start this form on winows Apache configuration then it's works correct.

 

Reproduce code:
---------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Beispielformular</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<form action="script.php" method="POST">
  <input type="hidden" name="secret_var" value="1">
    Vorname und Familienname:<br>
  <input type="text" name="name" value="Otto Normalverbraucher"><br>
    Passwort:<br>
  <input type="password" name="passwd"><br>
    Geschlecht:<br>
  <input type="radio" name="sex" value="m"> m&auml;nnlich<br>
  <input type="radio" name="sex" value="w"> weiblich<br>
    Hobbys:<br>
  <input type="checkbox" name="hobbys[]" value="computers"> Computer<br>
  <input type="checkbox" name="hobbys[]" value="sport"> Sport<br>
  <input type="checkbox" name="hobbys[]" value="books"> B&uuml;cher<br>
    Kommentar:<br>
  <textarea name="comment" rows="4" cols="20"></textarea><br>
<input type="submit" name="sent" value="Abschicken">
</form>
</html>

<?php
if ($_POST) {
  echo "<p>Mit der Methode POST erhaltene Daten:</p>";
  while (list($post_var, $post_value) = each($_POST))
  {
    echo $post_var." = ".$post_value."<br>";
  }
}
if ($_GET) {
  echo "<p>Mit der Methode GET erhaltene Daten:</p>";
  while (list($get_var, $get_value) = each($_GET))
  {
    echo $get_var ." = ".$get_value ."<br>";
  }
}
?>

Expected result:
----------------
null


Actual result:
--------------
all Fields and values

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-29 17:55 UTC] iliaa@php.net
You should use $_GET and $_POST and check the value of your 
variables_order and gpc_order inside PHP.ini. 
 [2004-06-30 20:41 UTC] kae at aals dot ch
I have this php.ini value:
variables_order = "EGPCS"
register_long_arrays = Off
register_globals = on
register_argc_argv = Off
post_max_size = 8M
gpc_order = "GPC"
 [2004-07-06 15:37 UTC] sniper@php.net
The variables are called $_GET and $_POST (yes, the case matters!)

 [2004-07-06 21:24 UTC] kae at aals dot ch
Sorry, but read all this script. It's not a case matter.

<?php
if ($_POST) {
  echo "<p>Mit der Methode POST erhaltene Daten:</p>";
  while (list($post_var, $post_value) = each($_POST))
  {
    echo $post_var." = ".$post_value."<br>";
  }
}
if ($_GET) {
  echo "<p>Mit der Methode GET erhaltene Daten:</p>";
  while (list($get_var, $get_value) = each($_GET))
  {
    echo $get_var ." = ".$get_value ."<br>";
  }
}
?>
 [2004-07-07 01:54 UTC] philip@php.net
Here's a better test, give us the output after the submit:

<html>
<body>
<form action="script.php" method="POST">
 <input type="hidden" name="atest" value="avalue">
 <input type="submit" name="submit">
</form>
<pre>
<?php
print phpversion() . "\n";
print ini_get('variables_order') . "\n\n";

print "POST:\n";
print_r($HTTP_POST_VARS);
print_r($_POST);

print "GET:\n";
print_r($HTTP_GET_VARS);
print_r($_GET);
?>
</body>
</html>
 [2004-07-19 20:26 UTC] kae at aals dot ch
I test this Procedure and the result is:
after test.php

5.0.0
GPCS

POST:

Notice:  Undefined variable:  HTTP_POST_VARS in C:\Inetpub\wwwroot\de\borowski\test.php on line 13
Array
(
)
GET:

Notice:  Undefined variable:  HTTP_GET_VARS in C:\Inetpub\wwwroot\de\borowski\test.php on line 17
Array
(
)
after submit
nothing is appear.

Here is the Inifilepart:

;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
;
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3

; The separator used in PHP generated URLs to separate arguments.
; Default is "&".
;arg_separator.output = "&amp;"

; List of separator(s) used by PHP to parse input URLs into variables.
; Default is "&".
; NOTE: Every character in this directive is considered as separator!
;arg_separator.input = ";&"

; This directive describes the order in which PHP registers GET, POST, Cookie,
; Environment and Built-in variables (G, P, C, E & S respectively, often
; referred to as EGPCS or GPC).  Registration is done from left to right, newer
; values override older values.
variables_order = "GPCS"

; Whether or not to register the EGPCS variables as global variables.  You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data.  This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on;  Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off

; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends.  If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = OFF

; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information).  If you don't use these variables, you
; should turn it off for increased performance.
register_argc_argv = Off

; Maximum size of POST data that PHP will accept.
post_max_size = 8M
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 04:03:39 2023 UTC