How do I see which button I clicked using PHP?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandipnawale
    New Member
    • Sep 2007
    • 1

    How do I see which button I clicked using PHP?

    how can i get which button i have click in php
  • gregerly
    Recognized Expert New Member
    • Sep 2006
    • 192

    #2
    Originally posted by sandipnawale
    how can i get which button i have click in php
    Are you reffering to an html <button> or <input type='submit'>? If so, the button name is available in the post or get array (depending on how your submitting the form). Maybe you can elaborate on the problem your having. Post some code of the problem your actually having and we might be able to help more.

    Greg

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      PHP does not have events like you see in other languages, like .Net.
      PHP is executed server-side, so nothing that happens in your browser can trigger any PHP code. That is of course unless it uses Ajax or causes the page to reload.

      All buttons and such things belong to client-side scripts, like JavaScript.

      But as Greg says, data sent through HTML forms can be read by PHP as they are received by the server.

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        I've changed the title of this thread to better describe it's topic.
        Using good, descriptive titles that follow the Posting Guidelines will increase your chances of getting you questions answered!

        Moderator

        Comment

        Working...