[En-Nut-Discussion] Saving application settings does not work

Jari Seppälä jari.seppala at postikaista.net
Sun Jan 15 19:17:05 CET 2006


Here is the problem commented in code.

//settings.h
typedef struct {
	u_char *mysetting;
} SETTINGS;

extern SETTINGS settings;

//code
static int ASPCallback (char *pASPFunction, FILE *stream)
{
    if (strcmp(pASPFunction, "mysetting") == 0) {
        fprintf(stream, settings.mysetting);
        return(0);
    }
}

int ProcessCgi(FILE * stream,REQUEST * req)
{

    NutHttpProcessPostQuery(stream, req);

    //If i use this, results is strange characters to the "mysetting" field
on the form
    settings.mysetting=NutHttpGetParameter(req, "mysetting");

    //next line works fine and "mysetting" field is string "somevalue",
why???
    settings.mysetting="somevalue";
}

thanks,
-jari




More information about the En-Nut-Discussion mailing list