txn
10-06-2006, 06:39 AM
Hi folks,
I am new in cgi web programming here. I have a problem between html and cgi. Basically, i am trying to write a calculator in cgi and then put it in web server. When user go to my site will see the html page below:
html code
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<FORM ACTION="default.cgi" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">
<H2>Evaluate Reverse Polish Expression</H2>
<P>
<TABLE BORDER="0" WIDTH="490">
<TR>
<TD WIDTH="71%">
<P ALIGN="CENTER">Enter a reverse polish expression to evaluate:
</TD>
<TD WIDTH="15%"> </TD>
<TD WIDTH="14%"> </TD>
</TR>
<TR>
<TD COLSPAN="3">
<CENTER>
<P><INPUT TYPE="TEXT" NAME="Field" SIZE="50">
</CENTER>
</TD>
</TR>
<TR>
<TD WIDTH="71%"> </TD>
<TD WIDTH="15%">
<CENTER>
<P><INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit">
</CENTER>
</TD>
<TD WIDTH="14%">
<CENTER>
<P><INPUT TYPE="RESET" NAME="Reset" VALUE="Reset">
</CENTER>
</TD>
</TR>
<TR>
<TD COLSPAN="3">
<P ALIGN="CENTER">The value of the expression 1 2 3 + * is 5
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
And they will put the function in the text area then click submit. And then that information will be transfer to my cgi script which will calculate and then put it on same html page. Can anyone tell me how to do that ?, i got the cgi working now, but still not figure out how to make it work with those html code above. Hope my explaination make sense. thanks
I am new in cgi web programming here. I have a problem between html and cgi. Basically, i am trying to write a calculator in cgi and then put it in web server. When user go to my site will see the html page below:
html code
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<FORM ACTION="default.cgi" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">
<H2>Evaluate Reverse Polish Expression</H2>
<P>
<TABLE BORDER="0" WIDTH="490">
<TR>
<TD WIDTH="71%">
<P ALIGN="CENTER">Enter a reverse polish expression to evaluate:
</TD>
<TD WIDTH="15%"> </TD>
<TD WIDTH="14%"> </TD>
</TR>
<TR>
<TD COLSPAN="3">
<CENTER>
<P><INPUT TYPE="TEXT" NAME="Field" SIZE="50">
</CENTER>
</TD>
</TR>
<TR>
<TD WIDTH="71%"> </TD>
<TD WIDTH="15%">
<CENTER>
<P><INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit">
</CENTER>
</TD>
<TD WIDTH="14%">
<CENTER>
<P><INPUT TYPE="RESET" NAME="Reset" VALUE="Reset">
</CENTER>
</TD>
</TR>
<TR>
<TD COLSPAN="3">
<P ALIGN="CENTER">The value of the expression 1 2 3 + * is 5
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
And they will put the function in the text area then click submit. And then that information will be transfer to my cgi script which will calculate and then put it on same html page. Can anyone tell me how to do that ?, i got the cgi working now, but still not figure out how to make it work with those html code above. Hope my explaination make sense. thanks