Hi.

I'm using PHP 4.0.3 on NT 4 and IIS 4.

The post method does not return the expected PHP4 variable (e.g. the first_name text box in the form does not return the $first_name variable in the php file specified in action attribute).

However, I don't face this problem with PHP 4.0.4 on my Linux box at home.

How do I rectify the problem that exisits with IIS. Unfortunately, my office is an NT 4 / Win2K environment (sigh).

Your advice is greatly appreciated.

Regards.

Kelvin

    1) check the scope of your variables

    2) does $HTTP_POST_VARS["first_name"] contain the expected data?

    3) what does the code look like?

      Hi Brandon.

      Here's what I've found out:

      1) check the scope of your variables
      How do I check this?

      2) does $HTTP_POST_VARS["first_name"] contain the expected data?
      Yes, $HTTP_POST_VARS["first_name"] contains the expected data.

      3) what does the code look like?

      I reduced my code to this (below) in an attempt to isolate the problem.
      ...
      <body>
      <?php
      print("<p>First name: " . $first_name . "</p>");
      ?>
      </body>
      ...

      The output was First name: (blank)

      However, when I replaced $first_name to $HTTP_POST_VARS["first_name"], the output was First name: Kelvin (assuming I typed Kelvin into the text box of the preceding form).

      ...
      <body>
      <?php
      print("<p>First name: " . $HTTP_POST_VARS["first_name"] . "</p>");
      ?>
      </body>
      ...

      What do I do now?

      Regards.

      Kelvin

        normally php will make the var $HTTP_POST_VARS["first_name"] available as $first_name, if its not doing so make sure register_globals is on in php.ini and gpc_order is GPC

          11 days later

          Hi,

          what can be done if $HTTP_POST_VARS["first_name"] does NOT contain data??

          This problem appears with Apache 1.3.12 and PHP 3.0.18 build as CGI (not as module).

          Any help would be very appreciated!

          Greetings,

          Thomas

            2 months later

            Hi,

            I am having perhaps the same trouble. I can pass a variable with the GET method but the POST method fails. I have tried all the solutions in this thread without success. When I upload my scripts to my Linux webserver the POST method works with a problem. I think the problems is a combination of Apache (1.3.14) and Windows2000. I too am using PHP4 as CGI. I would really like to resolove this issue so I can at least develop on my Windows2000 machine.

            Lets hope someone can help.

            Garry

              10 months later

              in the php.ini, set
              register_globals=on
              register_argc_argv = On
              hope this helps

                a month later

                Same trouble here. I've tried using $HTTP_POST_VARS, but it still doesn't work.

                I'm using it on a form that has been running quite happily for the last 6 months or so, but just this last week, I noticed that none of the POST vars on my site want to get passed. It's fine on my machine (Win98 running PHP 4.0.something on Apache) and always has been, but my host must have changed something. As far as I can tell they're running PHP 4.0.3/4 on Apache over a UNIX box. I've emailed them to ask what has happened, but I'm willing to bet money that they've got no idea or I get no reply.

                Is there anything in my scripts I can change to try and get around this? Is this a problem because of thier php.ini file that I have no influence over?

                  5 months later

                  Thanks I was having this problem but with this postings and help I have fixed my problem, God bless you all, Juba

                    Write a Reply...