Announcement

Collapse
No announcement yet.

CGI with PB/DOS

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

  • CGI with PB/DOS

    Can anyone tell me why the following code won't work?
    I've been trying for days already

    open "cons:" for output as #1
    print #1, "Content-type: text/html"
    print #1, "<HTML><BODY>"
    print #1, "Hello...<BR>"
    print #1, "</BODY></HTML>"
    close #1

    Any help would be very much appreciated!

    Kris

    -------------
    Beat me up, Scotty

  • #2
    Try using STDOUT instead. You are using PB 3.5, right?

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      I'm using the trial version.
      I think it's 3.2.

      ------------------
      Beat me up, Scotty

      Comment


      • #4
        This might help.


        'Gary Russell ISSW
        'FEB 15 2000
        '[email protected]
        'www.janics.com/~garussell
        'compiled using PowerBasic 3.5

        ' This will print to the web browser sending the request to the server
        'pointed to by the IP address in the html form. If you compiled the program
        'as cgiprt and put it in the cgi-bin directury of the web server software.
        'And have the server software running, and the calling brawser is on the
        'same computer as the web software. This shud work. If you are using this on
        'a eather net use the IP address of the server like 192.168.0.1 or on the
        'web use the IP address of the server.


        '<!- The HTML code ->
        '<HTML>
        '<Head><Title>PBasic CGI</Title></Head>
        '<Body bgcolor=ffffff>
        '<CENTER><P>
        '<H1><FONT COLOR=0000FF>POWERBASIC EXAMPLE FOR CGI PROGRAMMING.</FONT></H1>
        '<FORM ACTION="http://127.0.0.1/cgi-bin/cgiprt.exe" METHOD="POST">
        '<INPUT TYPE="SUBMIT" VALUE="Send"></CENTER></FORM>
        '</Body>
        '</HTML>


        'The PowerBasic code.
        stdout "Content type: text/html"
        stdout ""
        stdout "<html>"
        stdout "<body>"
        stdout "<center><br><b>This is it!</b></center>"
        stdout "<center><font size='12' color='blue'><b>HI</b></center>
        stdout "</body>"
        stdout "</html>"

        'The END!



        ------------------

        Comment


        • #5
          Kris, the rules of the BBS require that a real name is used (first+last)... handles and alias's are not permitted. Please reregister correctly before posting further questions! Thanks!

          BTW, PB3.2 does not support STDOUT but there are routines available to emulate STDOUT... however, the low purchase price of PB3.5 may not make the effort worth while when 3.5 has STDOUT built-in.



          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            The routines Lance referred to are in the Example directory under where you installed PB 3.2 in a file called DOSUNIT.BAS. You can $LINK in the DOSUNIT.PBU to use the routines.

            Jason

            ------------------

            Comment


            • #7
              Originally posted by Lance Edmonds:
              Kris, the rules of the BBS require that a real name is used (first+last)... handles and alias's are not permitted. Please reregister correctly before posting further questions! Thanks!
              Sorry 'bout that.
              I've registered again......
              Hope this is better

              ------------------
              Ready when you are, Shaky!
              All that runs automatically,
              can fail automatically...

              Comment


              • #8
                OK, enough is enough!
                I just bought PB/CC, and it works great!
                (But how do I get the books? )
                Thanx for trying to help me out anywayz....

                Kris

                ------------------
                Ready when you are, Shaky!
                All that runs automatically,
                can fail automatically...

                Comment


                • #9
                  Which books? If you mean the PB/CC printed documentation, the you can order it online, or call the PowerBASIC sales department directly. Note that the printed documentation for PB/CC contains much the same information as the PBCC.HLP file shipped with PB/CC.

                  ------------------
                  Lance
                  PowerBASIC Support
                  mailto:[email protected][email protected]</A>
                  Lance
                  mailto:[email protected]

                  Comment


                  • #10
                    I noticed...
                    Already printed the .HLP file.

                    Great poduct, by the way!

                    Thanx again to you guys trying to help me out!
                    C'ya 'round at the PB/CC forum

                    ------------------
                    Ready when you are, Shaky!
                    All that runs automatically,
                    can fail automatically...

                    Comment

                    Working...
                    X