Ok, I started off with the bad practice of just pulling my form data with just using a $fieldname.

I realized the error of my ways and started using $HTTP_POST_VARS['fieldname']. Now I've reinstalled php on my machine and HTTP_POST_VARS no longer has my variables, but it's in $_POST['fieldname'];

I verified this with phpinfo().

So to keep from having to rewrite everything is there somewhere I can get my HTTP_POST_VARS back??

I checked to make sure register_globals was on in php.ini and it is....

    • [deleted]

    Well, you can always place this at the top of your script:

    $HTTP_POST_VARS = $_POST;

    That will place everything in $_POST into $HTTP_POST_VARS....

      I could do that and it would work, but then I'd have to go through and fix every script for every app I've written for each company that we host.

      I don't have time to do that. I'm really looking for why it's doing this, not trying to put in a crutch to make it work.

        I thought that php introduced the $POST and $GET arrays etc in 4.1 or something, but I was SURE that HTTP_POST_VARS and such were left alive. My server is way out of date and doesn't even support $_POST, so I cannot test.

        Check php.net ChangeLog to see if it was removed?

          Found this in http://www.php.net/manual/en/language.variables.predefined.php

          $_POST
          Variables provided to the script via HTTP POST. Analogous to the old $HTTP_POST_VARS array (which is still available, but deprecated).

          But I can't get to it at all... maybe they turned it off and forgot to tell someone? Anyway, if that is the case you guys be careful before you upgrade your servers.

            What versions of Apache and PHP are you running?

            thanks

            PHPdev

              it's a redhat 8 beta

              from phpinf0()
              Apache/2.0.36 (Red Hat Linux)
              PHP Version 4.2.2

              PHP_SELF = /index.php
              POST["test"] = tyuityui

              POST["Submit"] = Submit

              _SERVER["UNIQUE_ID"] = qipozUQ-KDsAABXmEXgAAAAB

              './configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-experimental-zts' '--with-apxs2=/usr/sbin/apxs'

              See, I have _POST but no HTTP_POST_VARS...

              I think I installed this from RPM. Maybe Redhat did something weird to disable it.

                I currently have two servers running 4.2.3 and one running like 4.2.2. The $HTTP_POST_VARS[] do not show up in my phpinfo() but I can still use them. I dont think this is an issue with your version of PHP. I am not running Apache 2.X on any of our servers, but I can not think of how that would be an issue with PHP variables.

                Hope this helps, and when you get it figured out, let me know

                Thanks

                PHPdev

                  Write a Reply...