Am I Going Mad Here?

Discussion in 'PHP' started by shinycurves, Nov 3, 2007.

  1. #1
    Hi all,

    I'm having a little trouble with forms and retrieving the values! I can't believe this but I can't get the thing to work!! :mad:

    comment_test1.php:
    Simplified version of my contact form, nothing to difficult here.
    
      <form action="/comment_test2.php" method="post" id="cForm" style="padding:6px;">
        <input type="hidden" id="pageID" value="123456"/>
        <input type="hidden" id="referringURL" value="http://127.0.0.1/"/>
        <input type="text" id="posName" tabindex="1" value=""/>
        <input type="submit"/>
     </form>
    
    Code (markup):
    and in comment_test2.php:
    
    <pre>
      <?php var_dump(get_defined_vars()); ?>
    </pre>
    
    Code (markup):
    Again, nothing to difficult. Now the thing that gets me is this, when all the vars are dumped, $_REQUEST and $_POST are blank.

    
    ["_POST"]=>
          array(0) {
          }
          ["HTTP_POST_VARS"]=>
          array(0) {
          }
          ["_GET"]=>
          array(0) {
          }
          ["HTTP_GET_VARS"]=>
          array(0) {
          }
          ["_COOKIE"]=>
          array(0) {
          }
          ["HTTP_COOKIE_VARS"]=>
          array(0) {
          }
    
    ["_REQUEST"]=>
        array(0) {
        }
    
    
    Code (markup):
    This all stopped working when my host upgraded the server to new os/new apache/new php/new mysql, can anybody point me in the direction of a workaround or what I should ask my host to modify?

    Versions, all have been upgraded
    FreeBSD: 6.2 (from 4.2)
    Apache: 2.2.4 (from 1.1.2 i think)
    PHP: 5.2.4 (from 4.3?)
    MySql: 5.0.41 (from 4.something)
    Zend Engine v2.2.0 (from unknown)

    If anybody could shed some light onto this, id be grateful.

    Thanks in advance.
     
    shinycurves, Nov 3, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Your form fields need a name, the ID isn't passed by the browser.
     
    nico_swd, Nov 3, 2007 IP
  3. shinycurves

    shinycurves Member

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    And I forgot to mention that this is the same on WinXP Firefox + IE6 and on Vista IE7 + Firefox
     
    shinycurves, Nov 3, 2007 IP
  4. shinycurves

    shinycurves Member

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    LOL Your joking!

    Well, that fixed it, but how come it has been working fine for two years and suddenly stopped? Oh well, at least it works now. Thanks for your help!!

    Cheers!
     
    shinycurves, Nov 3, 2007 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    I'm sure it never worked that way before. Unless you were using a weird non-standard browser from the black market. :p
     
    nico_swd, Nov 3, 2007 IP