Announcement

Collapse
No announcement yet.

CGI applications using PB 3.5/DOS

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

  • CGI applications using PB 3.5/DOS

    Is it possible to write simple CGI stuff in PB for DOS? All I
    require would be a simple program to randomly choose a .MID file
    (from a text file list, etc.) and send the name of the
    .MID file to a browser to play. Does anyone have any examples
    of CGI stuff using PB? I don't want to learn icky Perl or
    anything that drastic!

  • #2
    Any programming lanuage that has stain and stout can do cgi scripts. And PowerBASIC has both.
    Gary

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

    Comment


    • #3
      Originally posted by Gary Russell:
      Any programming lanuage that has stain and stout can do cgi scripts. And PowerBASIC has both.
      Gary
      Hmmm.... well, that much I know. Any examples? How do I pass the
      name of the randomly selected midi file back to the browser?



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

      Comment


      • #4
        posted February 15, 2000 08:37 AM         
        --------------------------------------------------------------------------------
        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
          Jim,

          PWS for Windows 95/98 supports something called "WinCGI" that allows a DOS application to act as a CGI app.

          IIS in Windows NT/2000 does not support DOS apps as CGI. Netscape's server does, as does the O'Reilly server.

          The instructions for using a DOS application for CGI are included with each web server, since all web servers are different.

          --Dave


          ------------------
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Home of the BASIC Gurus
          www.basicguru.com

          Comment

          Working...
          X