Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

CGI

hi,

i 've read that the httpserver within Ecos supports CGI.

How to use CGI in httpserver?

In other webserver with CGI support the executeable cgi file has to be located in a directory like cyg-bin. How about the one within ecos?

Thnx

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Documentation on how to use the eCos web server can be found in eCos reference manual. This is installed along with the rest of eCos. Alternatively, you can find a copy here (http://ecos.sourceware.org/docs-latest/ref/net-httpd-chapter.html).

    The section "Server Organisation" explains how to associate a function with a filename within the server. Subsequent sections explain how you can generate HTML content. This is not strictly CGI, but it achieves the same thing.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi monkeyboy,

    i've tried to read some enviroment variables. The function i used is:

    char *content;

    content = getenv(CONTENT_TYPE);

    content = getenv(REMOTE_HOST);

    ...

    it seems that i cannot read the enviroment variables. Does the webserver within ecos support full CGI scripting?

    Thnx
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    From your other posts, I guess you've already worked this out, but the eCos web server does not support CGI. However it does support dynamic content generation.