Minor issue

Discussion in 'PHP' started by GSP, Dec 22, 2011.

  1. #1
    Hello,

    In every form i have 5-7 inputs. (method="post")

    I always use long procedure :mad:
    Like this:
    $username = $_POST['username'];

    Is there any possibility to reduce this long phrases?

    Thanks
     
    Solved! View solution.
    GSP, Dec 22, 2011 IP
  2. #2
    Hi,

    Instead of using it with every post variable, you just need to add at the top of your PHP code the following code:

    http://www.pasteit.in/132

    Then you will not need to define username as $_POST in the script.

    :)
     
    thegr4, Dec 23, 2011 IP
  3. GSP

    GSP Greenhorn

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #3
    Thanks, works perfect ;)
     
    GSP, Dec 23, 2011 IP
  4. jj@24khost

    jj@24khost Greenhorn

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #4
    well i am glad you got that solved we were not able to get here faster to help you.
     
    jj@24khost, Dec 23, 2011 IP
  5. deepmore88

    deepmore88 Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    using the same code..
    will be beneficial if found any compact code for it.
     
    deepmore88, Dec 24, 2011 IP