MIPL

Media-Independent Presentation Language

  HOME

  OVERVIEW

 IMPLEMENTATION

 MIPL TAGS
   ASK
   ASKITEM
   DATAIN
   EXIT
   FORM
   GOTO
   HIDDEN
   INVALID
   MENU
   MENUEND
   MIPL
  
NAME="label"
   NOINTERRUPT
   PREFER="mode"
   RECORD

   SELECT
   SELECTION="char"
   SUBMIT
   TIMEOUT
   VOICE
   VOICERATE="rate"
   comment

 SCRIPT EXAMPLES
  Example
  Example-1
  Example-2

 SOURCE
  Example

 


Source code of the post-query-mipl(.c) program that runs as a standard CGI program (in this case, under Apache on a UNIX box):

#include <stdio.h>

#include <stdlib.h>

#define MAX_ENTRIES 10000

 

typedef struct {

char *name;

char *val;

} entry;

 

char *makeword(char *line, char stop);

char *fmakeword(FILE *f, char stop, int *len);

char x2c(char *what);

void unescape_url(char *url);

void plustospace(char *str);

 

main(int argc, char *argv[]) {

entry entries[MAX_ENTRIES];

register int x,m=0;

int cl;

 

printf("Content-type: text/html ",10,10);

printf("<MIPL>\n");

 

if(strcmp(getenv("REQUEST_METHOD"),"POST")) {

printf("This script should be referenced with a METHOD of POST.\n");

printf("</MIPL>\n");

exit(1);

}

if(strcmp(getenv("CONTENT_TYPE"),"application/x-www-form-urlencoded")) {

printf("This script can only be used to decode form results. \n");

printf("</MIPL>\n");

exit(1);

}

Copyright by H.R. Jim Dixon 1999 All Rights Reserved