ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RPG CGI Paramters

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RPG CGI Paramters

    Hi Guys,

    Need your expert advice on RPG CGI.

    After calling the RPG CGI program from HTML Can we receive parameters from HTML in PLIST in RPG program or it is mandatory to use ZHBGETVAR procedure.?

    Thanks in advance.

  • #2
    Re: RPG CGI Paramters

    are you using CGIDEV2 or trying to write your own set of functions?
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: RPG CGI Paramters

      Originally posted by jamief View Post
      are you using CGIDEV2 or trying to write your own set of functions?
      Hello Jamief

      Thanks for the reply.

      I am trying to use basic CGI in my program can we receive the params from HTML with PLIST.

      I know CGIDEV2 has inbuilt procedures ZHBGETVAR etc.

      Comment


      • #4
        Re: RPG CGI Paramters

        I suppose you could if you wrote a wrapper program to retrieve the CGIDEV2 parms with ZhbGetInput() and to pass them to your main program through a "normal" parameter list. It's not clear why you'd want to, though.

        Tom
        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment


        • #5
          Re: RPG CGI Paramters

          I have some cgi written in 1999 -- I'm not sure I can find the source, but I will look!

          Jamie
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: RPG CGI Paramters

            CGIDEV2 is a set of routines that aim to make it easy for you to write web programs in RPG. Is it manditory to use it? Heck no. You could use/write your own routines that retrieve the data from the HTTP server and interpret them. Or call the IBM APIs that do that. Or use a different package from CGIDEV2 such as RPGsp, eRPG SDK, or any of about 30 other options.

            Is there a way to make it pass parameters (hopefully you're not still using the PLIST opcode in 2013?!?!) to your program? Sure. You could write a program that receives the data from the HTTP server and builds a PLIST and calls a program. That wouldn't even be very difficult... I could whip up a bare-bones (but functional) program that does that in about an hour. But, that's not a very versatile way to do it... and it doesn't really solve a problem. I've never heard of an RPG programmer who said "yeah, I found it really easy to manage the HTML, CSS and Javascript of the page. I had no trouble grasping statelessness or session management.... but gosh I found calling zhbGetVar() to be difficult.

            You see what I mean? By comparison to all of the other stuff you need to know and understand to create web applications, retrieving the URL-encoded parameters is really quite simple.

            If you don't want to have to learn all of the web coding techniques, there are some great packages out there that make it easy. For example, my employer (Profound Logic) has a tool where you can easily build web applications just by dragging and dropping components onto a screen. You don't have to know how the underlying technologies like HTML, CSS and JAvaScript work, you just drag and drop and build screens quickly and easily. And it interfaces to RPG as a display file, so you can just EXFMT your web screens, etc. Extremely easy to learn.

            But, if you are going to take all the time/effort to learn the web technologies (as required with something like CGIDEV2, or even more so with raw CGI), surely the effort of receiving the data from the browser is one of the easiest parts??!

            Comment

            Working...
            X