TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Media De Alunos Em PHP

Artigo: Media De Alunos Em PHP. Pesquise 860.000+ trabalhos acadêmicos

Por:   •  6/4/2014  •  352 Palavras (2 Páginas)  •  1.000 Visualizações

Página 1 de 2

<html>

<head>

<title> Michel</title>

</head>

<body>

<center>

<h4>Students' grades</h4>

<form action="pag.php" method="post" name="form1" id="form1">

<p>

<label for="nome">ALUNO:</label>

<input type="text" name="aluno" id="aluno" />

</p>

<p>

<label for="nota1">Nota 01: </label>

<input type="text" name="nota1" id="nota1" />

</p>

<p>

<label for="nota2">Nota 02: </label>

<input type="text" name="nota2" id="nota2" />

</p>

<p>

<label for="nota2">Nota 03: </label>

<input type="text" name="nota3" id="nota3" />

</p>

<p>

<label for="nota2">Nota 04: </label>

<input type="text" name="nota4" id="nota4" />

</p>

<p>

<input type="submit" name="btn_enviar" id="btn_enviar" value="CALCULAR" />

<input type="reset" name="btn_limpar" id="btn_limpar" value="LIMPAR" />

</p>

</form>

</center>

<table>

<tr>

<td>

<?php

$aluno = $_POST['aluno'];

$nota1 = $_POST['nota1'];

$nota2 = $_POST['nota2'];

$nota3 = $_POST['nota3'];

$nota4 = $_POST['nota4'];

$media = ($nota1 + $nota2 + $nota3 + $nota4) / 2;

if ($media >= 7){

echo "Aluno(a) $aluno foi aprovado(a) com media: $media";

}

else

echo "Aluno(a) $aluno foi reprovado(a) por ter media: $media";

?>

</td>

</tr>

</table>

</body>

</html>

<html>

<head>

<title> Michel</title>

</head>

<body>

<center>

<h4>Students' grades</h4>

<form action="teste.php" method="post" name="form1" id="form1">

<p>

<label for="nome">ALUNO:</label>

<input type="text" name="aluno" id="aluno" />

</p>

<p>

<label for="nota1">Nota 01: </label>

<input type="text" name="nota1" id="nota1" />

</p>

<p>

<label for="nota2">Nota 02: </label>

<input type="text" name="nota2" id="nota2" />

</p>

<p>

<label for="nota2">Nota 03: </label>

<input type="text" name="nota3" id="nota3" />

</p>

<p>

<label for="nota2">Nota 04: </label>

<input type="text" name="nota4" id="nota4" />

</p>

<p>

<input type="submit" name="btn_enviar" id="btn_enviar" value="CALCULAR" />

<input type="reset" name="btn_limpar" id="btn_limpar" value="LIMPAR" />

</p>

</form>

</center>

...

Baixar como (para membros premium)  txt (3.5 Kb)  
Continuar por mais 1 página »
Disponível apenas no TrabalhosGratuitos.com