$_POST[op]

Discussion in 'PHP' started by lektrikpuke, Oct 21, 2007.

  1. #1
    What is [op] in the title? I'm new to php, but op should be a fieldname and the code I took that from is not a fieldname as far as I can tell.
     
    lektrikpuke, Oct 21, 2007 IP
  2. pluswebdev

    pluswebdev Banned

    Messages:
    205
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it can be also hidden input name, ex. <input type="hidden" name="op" value="somevalue">
     
    pluswebdev, Oct 21, 2007 IP
  3. theOtherOne

    theOtherOne Well-Known Member

    Messages:
    112
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    op refers to a field of a form. When this form submits data to your script, $_POST['op'] stores the content of the field named op.

    * okay... too late ;) sorry pluswebdev
     
    theOtherOne, Oct 21, 2007 IP
  4. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #4
    post the entire form please
     
    nabil_kadimi, Oct 21, 2007 IP
  5. robca

    robca Well-Known Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    116
    #5
    so in my opinion it must be $_POST['op']
    didn't you forgot the '' ?
     
    robca, Oct 22, 2007 IP
  6. lektrikpuke

    lektrikpuke Well-Known Member

    Messages:
    297
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    113
    #6
    You guys are right. I guess I didn't try hard enough to find it in the code. Sorry to have wasted your time. :D
     
    lektrikpuke, Oct 22, 2007 IP
  7. theOtherOne

    theOtherOne Well-Known Member

    Messages:
    112
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #7
    never mind ;)

    @robca you do not need to put the " or ', because every unknown text will be automatically parsed into a string. It's not a good idea to get used to it though, because on some systems the interpreter puts a warning message. And it can lead to other unexpected / unwanted results... so better use the quotation marks ;)
     
    theOtherOne, Oct 22, 2007 IP
  8. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #8
    it SHOULD be:

    $_POST['op'] and NOT $_POST[op]
     
    phpl33t, Oct 22, 2007 IP