How use a Web Interface with a C command line program

This is a discussion on How use a Web Interface with a C command line program within the C Programming forums, part of the General Programming Boards category; I've written a small command line app in C for UNIX. I would like to make a GUI for this ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    1

    How use a Web Interface with a C command line program

    I've written a small command line app in C for UNIX. I would like to make a GUI for this application and my manager wants it to be webbased.

    Pretty much I want it so when buttons are pushed on this webpage it will call various functions in the C program as specific buttons are pressed and display information based on what the C program in writting to stderr or stdout.

    How would I go about starting a project like that?

  2. #2
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    what do you mean webbased? to send data over the network or open a page in a browser?
    for a gui you must use a library like qt, gtk or if on windows you can use win32 api.
    :wq

  3. #3
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    If you do indeed mean to be web based, where the user is using a web browser for the client, you need to learn how to do CGI (not computer generated imagry) or some other web application framework such as webserver plug-ins. Many people use PHP or Python to implement these sorts of things, but it can be done in C.

    Find references on CGI programming and similar techniques, and also look at the documentation for the web server you intend to use. If you don't intend to use this application through a web server, either as a plug-in or through CGI, you'll have to implement your own HTTP server, which is not trivial (though not too difficult, as micro-httpd and tinyHTTPd illustrate.
    Insert obnoxious but pithy remark here

  4. #4
    old man
    Join Date
    Dec 2005
    Posts
    90
    First of all, "web-based" in this case would mean that a browser would provide the GUI ...

    Next, you need a server-side scripting language since you can't execute code with html. Your choice of scripting language will depend on what's supported by your server (and your hosting company if you're not serving your own pages). edit: the idea here is to provide a wrapper to execute your C program.

    This isn't conspicuously a C question -- you might want to check with the web experts at sitepoint to see what's possible for you.
    Last edited by eerok; 01-18-2006 at 12:23 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 02:42 AM
  2. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 08:51 AM
  3. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM
  4. C program interface to JAVA
    By Duane in forum C Programming
    Replies: 2
    Last Post: 10-25-2001, 08:52 AM

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