|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-06-01 14:55 UTC] stas at cvs dot php dot net
[2000-06-12 18:09 UTC] zeev at cvs dot php dot net
[2025-03-28 10:32 UTC] git@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 13 07:00:01 2026 UTC |
I am running: Apache/1.3.12 (Unix) mod_perl/1.21 PHP/4.0RC1 mod_ssl/2.6.2 OpenSSL/0.9.5 and I am getting an intermittent problem with <?php_track_vars?> I have track_vars off as default but in one script I turn them on by putting <?php_track_vars?> in the first line of code. Most of the time all works fine but every so often the relevant variable ($HTTP_GET_VARS or $HTTP_POST_VARS) is not there. I have the following code in the page to test for the relevant variable: // DEBUG $fp=fopen("/tmp/".$Script, "w+"); fputs($fp, "action=".$action." email=".$email." key=".$key."\n"); $vars=array(); if ($HTTP_GET_VARS) {fputs($fp, "GET\n"); $vars=array_merge($vars, $HTTP_GET_VARS);} if ($HTTP_POST_VARS) {fputs($fp, "POST\n"); $vars=array_merge($vars, $HTTP_POST_VARS);} foreach(array_keys($vars) as $vn) { fputs($fp, $vn."=".$vars[$vn]." "); } fputs($fp, "\n"); fclose($fp); // END DEBUG $action, $email, $key are all passed either by GET or POST and are not set within the script. Every so often the temp file has values for the former three variables, but neither $HTTP_GET_VARS $HTTP_POST_VARS exist! I realise it is very hard to fix such a problem (It took me ages to detect it), but I am willing to help. You can see the entire script below: <?php_track_vars?> <?php global $SCRIPT_NAME; global $SCRIPT_FILENAME; $tmp=split("/", $SCRIPT_FILENAME); array_pop($tmp); $RFn=join("/", $tmp); $tmp=split("/", $SCRIPT_NAME); $Script=array_pop($tmp); $Fn=$RFn."/d/gen/SecureTransfer/".$Script; if (file_exists($Fn)) { include "$Fn"; unlink("$SCRIPT_FILENAME"); unlink("$Fn"); include "index.php"; } else { include "GlobalVars.phpi"; GlobalInclude("HtmlHead.phpi"); GlobalInclude("AuthComplex.phpi"); $fp=fopen($Fn, "w+"); flock($fp, LOCK_EX); fputs($fp, "<?php "); $vars=array(); global $HTTP_GET_VARS; global $HTTP_POST_VARS; if ($HTTP_GET_VARS) {$vars=array_merge($vars, $HTTP_GET_VARS);} if ($HTTP_POST_VARS) {$vars=array_merge($vars, $HTTP_POST_VARS);} foreach(array_keys($vars) as $vn) { fputs($fp, "$".$vn."=\"".$vars[$vn]."\"; "); } fputs($fp, "?>"); flock($fp, LOCK_UN); fclose($fp); // DEBUG $fp=fopen("/tmp/".$Script, "w+"); fputs($fp, "action=".$action." email=".$email." key=".$key."\n"); $vars=array(); if ($HTTP_GET_VARS) {fputs($fp, "GET\n"); $vars=array_merge($vars, $HTTP_GET_VARS);} if ($HTTP_POST_VARS) {fputs($fp, "POST\n"); $vars=array_merge($vars, $HTTP_POST_VARS);} foreach(array_keys($vars) as $vn) { fputs($fp, $vn."=".$vars[$vn]." "); } fputs($fp, "\n"); fclose($fp); // END DEBUG global $SERVER_NAME; $url="http://".$SERVER_NAME.$SCRIPT_NAME; echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'">'; include "i/secure.phpi"; } ?>