|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-21 14:54 UTC] peter dot valkov at total-graphics dot com
After form data is submitted to the script i have up to 3
header('Location: '.$newPage);
http redirects. In case i hit 3rd page where i have constant defined it is full with garbage !?!?!
define("CONSTANT","value");
if (CONSTANT != "value") die("Why is that?!?");
If i hit this page with same parameters but not from http redirect or using PHP 4.0.4pl1 everything is woking fine.
I can not expose entire script here because is quite big (2000 lines +).
I'm using IE 5.5 SP1.
Linux Mandrake 7.2
PHP 4.0.5 compiled --with-apxs --with-mysql --with-oci8
using egcs-2.91.66
libc-5.3.12
glibc-2.1.3
apache 1.3.14
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
I tryed to reproduce this and here is the script. I run 2 different SQL statements. First one is wrong (contains invalid table name) and second is correct. If there is an error in SQL statement script is terminated using die(). On next page hit after execution of wrong SQL statement i'm getting: [notice] child pid 7358 exit signal Segmentation fault (11) in Apache error_log file and mess in defined constants. In the original script there is no wrong SQL statements but somehow i'm getting same result. Obviously the problem is in OCI8 extention not in HTTP redirections. There is no problems running same script on PHP 4.0.4pl1. <?php define("CONSTANT", "value"); define("MAX_REDIRECTS", 10); define("LOGIN", "scott"); define("PASSWORD", "tiger"); define("DB", "oracle"); if (CONSTANT != "value") die($hitNo." failed."."<br> <a href='".$SCRIPT_NAME."?hitNo=".$hitNo."'>Click to continue.</a><br>"); $sql[0] = "select * from session_Log where userID=1"; $sql[1] = "select * from sessionLog where userID=1"; $hitNo = $hitNo ? $hitNo+1 : 1; function ociSelect(&$data) { global $sql, $hitNo, $SCRIPT_NAME; $conn = ociNLogon(LOGIN, PASSWORD, DB); if ($stmt = ociParse($conn, $sql[$hitNo % 2])) { if (!@ociExecute($stmt,OCI_DEFAULT)) { $error = ociError($stmt); die($error["message"]."<br> <a href='".$SCRIPT_NAME."?hitNo=".$hitNo."'>Click to continue.</a><br>"); } $nrows = ociFetchStatement($stmt, $data); ociFreeStatement($stmt); } else die("Cannot parse SQL statement."); ociCommit($conn); ociLogoff($conn); } ociSelect($data); if ($hitNo < MAX_REDIRECTS) { header("Location: ".$SCRIPT_NAME."?hitNo=".$hitNo); exit; } else echo $hitNo." HTTP redirects passed ok.<br> <a href='".$SCRIPT_NAME."'>Click to test it again.</a><br>"; ?>