How to use array for buttons in php site

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    How to use array for buttons in php site

    I'm developing web site using php. I have many pages which are having so many buttons. I want to put same button each and every page. Can I use array for that? If so how can I do that?
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Why not put the chunk of code that creates the buttons into a seperate file?
    Then simply 'include' the file on the required pages.

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      if there are slight differences for the button on each page, consider using printf() and related functions.

      Comment

      • ghjk
        Contributor
        • Jan 2008
        • 250

        #4
        hello code green,

        but different pages passes different variables. So how can I do that? I'm really confusing?

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          what are the differences?

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            You said you want the 'same button on each and every page'. If they're the same, why can you not just include them like codegreen suggested?

            Comment

            • ghjk
              Contributor
              • Jan 2008
              • 250

              #7
              But the thing is submit button on different pages get different variables.
              ex: page1 get 10 variables to submit to DB
              page2: submit an image to DB

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                that's no concern of the submit button. the sole purpose of it is to trigger the form submit. the submit itself is handled by the browser.

                Comment

                Working...