Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<TITLE>Calculo de porcentaje </TITLE>
<META content="text/html; charset=windows-1251" http-equiv=Content-Type>
<meta name="DESCRIPTION"content="Rockzillla">
<meta name="KEYWORD"content="venezuela.">
</HEAD>
<BODY style="FONT-FAMILY: Arial" bottomMargin=0 vLink=#000000 aLink=#000000
link=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 rightMargin=0 ? size="2"
face="arial" font>
<TABLE cellSpacing=0 cellPadding=0 width=720 align=center border=0>
<TBODY>
<TR bordercolor="#0099FF">
<TD vAlign=top width=150 bgColor=#F0F8FF><TABLE id=AutoNumber2 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 width=160 border=0>
<TBODY>
<TR>
<TD>
<div align="center"> </div>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD vAlign=top align=left width=420><TABLE cellSpacing=0 cellPadding=0 width=360 align=center border=0>
<TBODY>
<TR>
<TD valign="top">
<P align=center>
<SCRIPT language=JavaScript>
function perc1() {
a = document.form1.a.value/100;
b = a*40;
document.form1.total1.value = 40
}
function perc2() {
a = document.form1.c.value;
b = 40;
c = a/40;
d = c*100;
document.form1.total2.value = d
}
//-->
</SCRIPT>
<P align=center>
<FORM name=form1>
<TABLE width="510" height="100" border=1 cellPadding=1 cellSpacing=1>
<TBODY><TR>
<TD width="282" height="46"><font size="1">
<INPUT size=10 name=c>
porcentaje de
40 </font></TD>
<TD width="74"><font size="1">=
<INPUT size=10 name=total2>
%</font></TD>
<TD width="57"><font size="1">
<INPUT onclick=perc2() type=button value=Calculo>
</font></TD>
<TR>
<TD align=middle
colSpan=3>
<div align="center"> <font size="1">
<INPUT type=reset value=Reset>
</font></div> </TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</TD>
</TR></TBODY></TABLE></TD>
<TD vAlign=top align=left width=150 border="0" bgcolor="#F0F8FF"> </TD>
</TR></TBODY></TABLE>
<P align=center> <font face="Arial, Helvetica, sans-serif" size="2">
</font><BR>
<BR>
</BODY></HTML>