Er... well that's odd. What if you try this:

<?php if(empty($_SERVER['QUERY_STRING'])) { 
?><form action="<?php echo $_SERVER['PHP_SELF']; ?>?test" method="post"> 
<input type="submit" name="testing" value="Click Me"></form><?php 
} else { 
print_r($GLOBALS); 
}

EDIT: Well, since that'll certainly have a lengthy output, see if the following arrays are empty: HTTP_POST_VARS, POST, argbv (inside the SERVER array), _REQUEST .

I'm a bit baffled, because I just used my test script on Apache/2.0.59 (Win32) with PHP/5.2.0 (using the default configurations) and it worked fine, so I'm guessing it's a configuration issue with either Apache or PHP.

    bradgrafelman, that second snipppet shows this:

    Array
    (
        [GLOBALS] => Array
     *RECURSION*
        [_POST] => Array
            (
            )
    
    [_GET] => Array
        (
            [test] => 
        )
    
    [_COOKIE] => Array
        (
        )
    
    [_FILES] => Array
        (
        )
    
    [_SERVER] => Array
        (
            [HTTP_HOST] => localhost
            [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
            [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
            [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
            [HTTP_ACCEPT_ENCODING] => gzip,deflate
            [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
            [HTTP_KEEP_ALIVE] => 300
            [HTTP_CONNECTION] => keep-alive
            [HTTP_REFERER] => http://localhost/php_test2.php
            [CONTENT_TYPE] => application/x-www-form-urlencoded
            [CONTENT_LENGTH] => 16
            [PATH] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\ati technologies\ati control panel;c:\program files\quicktime\qtsystem\;c:\program files\securecrt\;C:\Program Files\MATLAB71\bin\win32;c:\Apache\php;C:\Apache\mysql\bin;C:\c\bin
            [SystemRoot] => C:\WINDOWS
            [COMSPEC] => C:\WINDOWS\system32\cmd.exe
            [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
            [WINDIR] => C:\WINDOWS
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache/2.2.3 (Win32) PHP/5.2.0RC3-dev
            [SERVER_NAME] => localhost
            [SERVER_ADDR] => 127.0.0.1
            [SERVER_PORT] => 80
            [REMOTE_ADDR] => 127.0.0.1
            [DOCUMENT_ROOT] => C:/Apache/htdocs
            [SERVER_ADMIN] => admin@localhost.com
            [SCRIPT_FILENAME] => C:/Apache/htdocs/php_test2.php
            [REMOTE_PORT] => 3473
            [GATEWAY_INTERFACE] => CGI/1.1
            [SERVER_PROTOCOL] => HTTP/1.1
            [REQUEST_METHOD] => POST
            [QUERY_STRING] => test
            [REQUEST_URI] => /php_test2.php?test
            [SCRIPT_NAME] => /php_test2.php
            [PHP_SELF] => /php_test2.php
            [REQUEST_TIME] => 1167606266
            [argv] => Array
                (
                    [0] => test
                )
    
            [argc] => 1
        )
    
    )

    It is really odd. Could it be a ini setting, or maybe should I upgrade apache?

      As I said, it almost has to be a configuration issue... though if you installed the WAMP server and haven't done any messing with the configs, I'm not sure.

      I suppose check if there's a newer WAMP version? If not, I would say just download Apache and PHP and throw your own setup together. If you've never done it before, there's guides for both (actually, Apache is pretty much just click-click-click-you're done) and it's really not that hard.

        If you want to test your configuration try changing your form processing to a separate script.

        <form action="temptest.php" method="post">

        Then create temptest.php as below:

        <?php
        print_r($_POST);
        ?>

        This will output what your form is sending via POST. This may help you understand the problem better.

        Blu

          I don't get why it would matter if a separate script is receiving the POST data or not... if the request method is set as POST (see the dump of $GLOBALS), yet there's still no data (when the same snippet works fine on other servers, e.g. my own)... I still wonder if it's not an Apache config issue.

            Well, if a separate script is receiving the POST data (which I would agree is unlikely given the evidence above) it would suggest it isn't a config issue, but if the separate script isn't receiving the data, then it confirms that it most likely is.

            You may well consider this overkill, I was just surprised that the GET method works. I thought it might be worth the two minutes it would take for the original poster.
            Blu

              The fact that "CONTENT_LENGTH" is 16 shows that at least some of the post data is being passed through Apache to PHP. The overhead (8) plus the length of "Click Me" (8) equals 16.

              A possibility, remote as it may be, is that in "php.ini", "auto_prepend_file" is set to a file that somehow clears the post data, e.g. by "$_POST = array()".

                Sorry for the lack of replies. I was away for New Years. I tried to process the form with a seperate script using the code Blulagoon suggested, and the output I got was "Array()" I checked the "auto_prepend_file" setting and it is not set. Any other suggestions? Thanks for the help so far.

                Also, here's a link to the phpinfo() output. http://www.prism.gatech.edu/~gtg481h/phpinfo.html

                Another thing, to clarify from my original post. I admitted trying to configure a wamp setup, not knowing that there is a software package with the same name. This is not what I am installing. I'm acually installing each component one at a time. I merely said "wamp" to describe my intended configuration. Sorry for the confusion.

                  I tried to process the form with a seperate script using the code Blulagoon suggested, and the output I got was "Array()"

                  Try a:
                  print_r($_POST);

                  EDIT:
                  hmm... I manually added a query string to your phpinfo page, but $_SERVER['QUERY_STRING'] is still empty. hmm....

                    How is this installed in Apache? Can you show us the config lines in the httpd.conf file? I'm finding some bug reports (example) that might shed some light on the situation.

                    Also, is there any reason why you wanted to compile the latest dev source instead of grabbing the latest compiled stable release?

                    laserlight wrote:

                    I manually added a query string to your phpinfo page

                    Well, he provided us a link to the .html output of the phpinfo() page, uploaded to a different server. Thus, we unfortunately can't tinker with the phpinfo() output via query strings and POST'ing data.

                      Finally got it. I checked your link bradgrafelman, and it seems my apache configuration file is missing the line "AddType application/x-httpd-php .php" When I added it, everything worked. The reason I'm using the dev source is because when I deceded to set up my WAMP configuration there were some incompatibilities between the latest stable releases of mysql and php which kept me from using them together. I think those issues have since been resolved, so I'm going to go ahead and upgrade everything to the latest versions to be safe. Again, thanks everyone for your help. I learned alot.

                        Write a Reply...