CGI and C++

This is a discussion on CGI and C++ within the C++ Programming forums, part of the General Programming Boards category; I have a web interface that I need to link with my c++ program. Can anyone tell me how to ...

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    32

    Lightbulb CGI and C++

    I have a web interface that I need to link with my c++ program. Can anyone tell me how to link the two of them either using CGI or dll.

    The program needs two parameters 1. File name 2. user name. The program then processes the information and spits out some results that needs to be displayed back on the screen.

    Can anyone tell me how you pass parameters to a CGI program as well as how to create one that will be helpful. Please give coding examples if possible.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Look into the CGIC library. It will allow you to compile C (and I'm assuming C++ also) code as CGI scripts.

    There are two ways to pass data to a CGI script. You can use the GET or POST method.
    Example of the form:
    Code:
    <form name="blah" method="post">
    <input name="name" type="text"/>
    <input type="submit"/>
    </form>
    To access the parameters as a string you would use the global variable cgiQueryString.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21