Skip to content
it4e edited this page Apr 16, 2016 · 1 revision

Name

<chl/chl.h>

chl_get, CHL GET

Declaration

char * chl_get(char * name);

Description

The chl_get function is used to fetch the value of the GET method variable [name].

Arguments

  • name: the name of the GET variable

Return value

On success: GET variable value, 0 if GET variable is not defined.


Examples

Call CHL controller file 'index.chl' with GET parameters (name=Olof, id=10)

index.chl?name=Olof&id=10

main.c

#include <chl/chl.h>
#include <stdio.h>

int main() {
    chl_set_default_headers();
    chl_print_headers();

    printf("%s has id %s.", chl_get("name"), chl_get("id"));
}

Output: Olof has id 10.

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally