From:             christoph at chcnet dot net
Operating system: win2k advanced server
PHP version:      4.3.2
PHP Bug Type:     Reproducible crash
Bug description:  CGI Application crashes obviously when redirecting webpage

Description:
------------
When calling my scripts like that:

/path/script.php?parm1=1&parm2=3 ....

via Javascript

<script language="javascript">
window.open("/path/page.php?parameter=123&clientname=some name", data)
</script>

IIS returns a screen:

CGI Error: The cgi application misbehaved by returning wrong HTTP-Headers.
Those are:


(nothing here...)

Obviously php in version 4.3.2 under IIS 5 on Win2k (SP4) advanced server
crashes.

setting error reporting to E_ALL doesn't show any hint, php simply
disappears without sending anything, and IIS prints the above mentioned
error message.

No zombie processes (php.exe) remain in the system, as the application
obiously quits correctly so I don't even get a message window, that
php.exe crashed (I have visual studio installed).

Is this a configuration issue (I haven't found nothing so far), because
the PHP version I use on my production machine works without errors.

Yes, I use $_GET and $_POST instead of using global variables (although I
have it enabled, because an older system, written in php requires it)



Reproduce code:
---------------
function show_documents($docid) {
    print $docid;
}
function update_documents($docid) {
        global $db;
        if ($_POST['parm1']=="") $_POST['parm1'] = 0;
        if ($_POST['parm2']=="") $_POST['parm2'] = 0;
        print "updating...";
        $sql = "update table set parm1=${_POST['parm1']};";
        mssql_query($sql, $db) or die ("ERROR!");
        ?>
        <script>
        window.open(<?php print
"\"documents.php?parm1=${_POST['parm1']}&parm2=${_POST['parm2']}\"";
?>,"data")
        </script>
        <?php
}


switch ($mode) {
        case "updatedoc": update_documents($docid); break;
        default: show_documents($docid); break;
}


Expected result:
----------------
calling the script from a form providing parm1 and parm2 does on
4.3.1-dev:

1) print updating.... and redirect the webpage to the same script without
parameter mode=updatedoc (this is for Updates and inserts in SQL, so that
the insert statement is not called 2x (and also the update)

The update script is called correctly, but when 


2) open the same script documents.php?docid=123
   should print 123


Actual result:
--------------
CGI Error... Application misbehaved by not returning a complete set ot
HTTP headers:




(here is nothing else, so PHP didn't write anything....

-- 
Edit bug report at http://bugs.php.net/?id=24788&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24788&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24788&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24788&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24788&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24788&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24788&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24788&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24788&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24788&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24788&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24788&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24788&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24788&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24788&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24788&r=gnused

Reply via email to