$_POST variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a10392
    New Member
    • Oct 2005
    • 3

    $_POST variable

    Hi,

    When i'am working (php) in my office and i execute a submit the variables are accessible just typing $variable, but home i have to type $_POST['variable']


    What change do i have to do in php.ini to use only the variable names after a form submit

    thanks in advance
  • Sepharoth
    New Member
    • Jul 2007
    • 5

    #2
    hello

    i dont know if this will help, but you can try

    [PHP]$variable = $_POST['variable'];[/PHP]

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      Originally posted by Sepharoth
      hello

      i dont know if this will help, but you can try

      [PHP]$variable = $_POST['variable'];[/PHP]
      FYI, you shouldn't use variables blindly without first checking if they are set.

      Comment

      • kovik
        Recognized Expert Top Contributor
        • Jun 2007
        • 1044

        #4
        Originally posted by a10392
        Hi,

        When i'am working (php) in my office and i execute a submit the variables are accessible just typing $variable, but home i have to type $_POST['variable']


        What change do i have to do in php.ini to use only the variable names after a form submit

        thanks in advance
        Then the people at your office are likely not very experienced with PHP, security holes, or proper coding standards. They have register_global s turned on, which is an extremely careless compromise of security.

        I'd suggest that you direct your superiors at your office to my article on the dangers of using register_global s in PHP.

        Comment

        • yatin
          New Member
          • Jun 2007
          • 5

          #5
          Originally posted by a10392
          Hi,

          When i'am working (php) in my office and i execute a submit the variables are accessible just typing $variable, but home i have to type $_POST['variable']


          What change do i have to do in php.ini to use only the variable names after a form submit

          thanks in advance
          You can do this by using the
          exec() function

          Comment

          • kovik
            Recognized Expert Top Contributor
            • Jun 2007
            • 1044

            #6
            Originally posted by yatin
            You can do this by using the
            exec() function
            ... That doesn't even make sense. :-/ What would the exec() command do?

            Besides, don't encourage anyone to use register_global s, as they are unnecessarily putting themselves at risk.

            Comment

            Working...