Lecture overview -- Keyboard shortcut: 'u'  Previous page: Markup hosting -- Keyboard shortcut: 'p'  Next page: Markup subsumption -- Keyboard shortcut: 'n'  Alphabetic index  Help page about these notes  Course home    Slide 6 : 15

Program hosting
XML fragments appear as constituents in a complete program
#include <stdio.h>
#include <stdlib.h>
int main(void)
  char *data;
  long m,n;
  printf("<TITLE>Multiplication results</TITLE>\n");
  printf("<H3>Multiplication results</H3>\n");
  data = getenv("QUERY_STRING");
  if(data == NULL)
    printf("<P>Error! Error in passing data from form to script.");
  else if(sscanf(data,"m=%ld&n=%ld",&m,&n)!=2)
    printf("<P>Error! Invalid data. Data must be numeric.");
    printf("<P>The product of %ld and %ld is %ld.",m,n,m*n);
  return 0;