topical media & game development

talk show tell print

lib-ch-example-ref-wcgi-mapPath.cgi / cgi



  #!/bin/ch 
  /* Copyright (c) 2001 by SoftIntegration, Inc. All Rights Reserved */
  include <wcgi.h>
  
  int main() {
    class CResponse Response;
    class CRequest Request;
    class CServer Server;
    chchar *path_virtual, *path_physical;
  
    Response.begin();
    Response.title(L"The Result of Test of Server.mapPath");
    printf("<H1> The Result of Test of Server.mapPath</H1><p>\n ");
  
    path_virtual = Request.getForm(L"mapPath");
    path_physical = Server.mapPath(path_virtual);
    if (path_virtual != NULL) {
      printf("the path of \"");
      fputws(path_virtual, stdout);
      printf("\" is mapped to \"");
      fputws(path_physical ? path_physical : L"(null)", stdout);
      printf("\" \n <p>\n");
    }
    else
      printf("Please input a valid virtual path to map<p>\n");
  
    Response.end();
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.