Esse é o código em HTML que eu fiz para o código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>
<form name="form1" method="post" action="teste.php">
<table width="28%" border="1">
<tr>
<td><input name="n" type="checkbox" id="n" value="1">
Texto 1</td>
</tr>
<tr>
<td><input name="nu" type="checkbox" id="nu" value="1">
Texto 2 </td>
</tr>
<tr>
<td><input name="num" type="checkbox" id="num" value="1">
Texto 3</td>
</tr>
</table>
<input type="submit" name="submit" value="Somar">
</form>
</body>
</html>
E direcionei para teste.php.
E o código do teste.php ficou assim, mas sempre dá zero....
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<script language="php">
$resultado = $n + $nu + $num;
echo "$resultado" ;
</script>
</body>
</html>
Tem como alguem me ajudar????