$_GET, $_POST Fomularvariable nicht erkannt
Manchmal kann ich in Funktionen mit $_GET, $_POSTS auf keine
Formularvariable zugreifen, bzw. sie sind leer.
Das passiert aber in der gleichen Funktion welche immer direkt nach dem Start des Programmes aufgerufen wird. Ich kann mir nicht erklären, warum es manchmal geht und manchmal nicht.
Re: $_GET, $_POST Fomularvariable nicht erkannt
Zitat:
Original geschrieben von Torsten.E
Manchmal kann ich in Funktionen mit $_GET, $_POSTS auf keine
Formularvariable zugreifen, bzw. sie sind leer.
Das passiert aber in der gleichen Funktion welche immer direkt nach dem Start des Programmes aufgerufen wird. Ich kann mir nicht erklären, warum es manchmal geht und manchmal nicht.
Wie schon einmal erwähnt es gibt da ein paar Scripte die dir die Globals killen.
Beispiel:
PHP-Code:
if (!ini_get('register_globals')) {
$types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
foreach ($types_to_register as $type) {
$arr = @${'HTTP_' . $type . '_VARS'};
if (@count($arr) > 0) {
extract($arr, EXTR_OVERWRITE);
}
}
}
Macht dir alle Konstanten und Globalen Variablen blatt und überschreibt sie.Wird gerne in Foren verwendet.
Setze mal in den Footer so etwas, am besten mit .htaccess
PHP-Code:
<FilesMatch "\\.(php|html?)$">
php_value auto_append_file "footer.php"
</FilesMatch>
In der Footer dann.
PHP-Code:
<?php
echo "<pre>";
print_r( $_GET );
print_r( $_POST );
print_r( $_COOKIE );
print_r( $_SESSION );
print_r( $_SERVER );
echo "</pre>";
?>
PS: Verwendest du zufällig output Buffering das kann es auch sein.