From what I can see the standalone.html is a static html page that displays an input box and a button thus
<HTML> <BODY> <FORM ACTION="/cgi-bin/mycgimagic.exe"> <P>Please specify the size: <INPUT NAME="size" SIZE="5"><BR> <INPUT TYPE="SUBMIT" VALUE="Go!"> </FORM> </BODY> </HTML>
When you press the button on the page, the request sent to the webserver is to execute the program /cgi-bin/mycgimagic.exe which is the compiled version of mycgimagic.m.
Using the size parameter extracted from the environment variable QUERY_STRING, the program computes the magic square and the response received by your browser is an html page created using the fprint(1,text) statements withing the program starting with this one
fprintf(1,'Content-type: text/html\n');and later these
function createTable(M) s = size(M); fprintf(1,'<table border = "2">'); for i=1:s(1) fprintf(1,' <tr>'); for j=1:s(2) fprintf(1,[' <td>',num2str(M(i,j),'%4.2f'),'</td>']); end fprintf(1,' </tr>'); end
hope that helps a bit
pojIn reply to Re: Linking Matlab to process data for Personal Web Server
by poj
in thread Linking Matlab to process data for Personal Web Server
by jyws89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |