Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

Codigo nao esta funcionando

$
0
0

código hmtl

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="_css/estilo.css"/>
    <meta charset="UTF-8"/>
    <title>padrão/title>
</head>
<body>
<div>
    <form method="post" action="media.php">
        <label for="primary">Nota 1: </label>
        <input type="text" name="nota1" id="primary"><br>
        <label for="secondary">Nota 2: </label>
        <input type="text" name="nota2" id="secondary"><br>
    <table align="left" bgcolor="black"></table>
        <input type="submit" value="Ver a media">
    </table>
    </form>


</div>
</body>
</html>

Código php:

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="_css/estilo.css"/>
  <meta charset="UTF-8"/>
  <title>padrão</title>
</head>
<body>
<div>
  <?php
  $nota1=$_POST["nota1"];
  $nota2=$_POST{"nota2"};
  $media= ($nota1+$nota2)/2;

  echo "As notas foram $nota1 e $nota2<br>";
  echo "A media do aluno e: $media<br>";



  if($media<5){
    $sit = "REPROVADO";
  }
  if($media==5 && $media>7) {
    $sit = "RECUPERACAO";
  }
  if($media>=7 && $media==10) {
    $sit = "APROVADO";
  }

  echo "A media do aluno e: $sit";

  ?>

</div>
</body>
</html>

Quero descobrir o motivo do erro


Viewing all articles
Browse latest Browse all 14190

Trending Articles