Jump to content

PHP Notice: Undefined variable: _Post


Recommended Posts

Help Please!!!

System: Win XP Pro sp2
PHP: 5.1.6
Apache: 2.0.59

I have PHP mostly running on my system but am having issues using PHP's superglobals, I keep running really basic scripts but keep getting the above or similar error for $_GET[].  Is there anything in the setups that I need to change to be able to use these?

Script 1 - I've also tried it with the POST method
<html>
  <head>
    <title>supertest1.php    </title>
  </head>
  <body>
    <form name="input" action="supertest2.php" method="get">
        <input type="text" name="rar">
        <input type="submit" name="submit" value="submit">
    </form>
  </body>
</html>

Script 2
<html>
  <head>
    <title>supertest2.php    </title>
  </head>
  <body>
      <?php
        echo "<br>Get: ".$_Get['rar'];
        echo "<br>Post: ".$_Post['rar'];
        echo "<br>Request: ".$_Request['rar'];
        echo "<br>Field Value: ".$rar;
      ?>
  </body>
</html>

So, if you see a problem with my scripts, please let me know.  If it's something else...I'm open to any ideas.

Thank you!
Link to comment
https://forums.phpfreaks.com/topic/25886-php-notice-undefined-variable-_post/
Share on other sites

Superglobals are all uppercase they are not mixed case. Variables are case sensitive. So $_Get is the not the same as $_GET. PHP will treat $_Get completely different to $_GET

So $_Get should be $_GET
$_Post should be $_POST
$_Request should be $_REQUEST

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.