aulinha
This commit is contained in:
75
aula1.php
Normal file
75
aula1.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Aula 1</title>
|
||||
<link rel="stylesheet" href="estilo.css">
|
||||
</head>
|
||||
<body>
|
||||
<header><h1>Aula 1 - PHP </h1></header>
|
||||
<nav></nav>
|
||||
<main>
|
||||
<form method="POST" action="aula1.php">
|
||||
<table>
|
||||
<tr><td>Nome:</td><td><input type="text" name="nome"></td></tr>
|
||||
<tr><td>Matrícula:</td><td><input type="text" name="mat"></td></tr>
|
||||
<tr><td>Nota 1:</td><td><input type="text" name="n1"></td></tr>
|
||||
<tr><td>Nota 2:</td><td><input type="text" name="n2"></td></tr>
|
||||
<tr><td><input type="reset" value="Limpar"></td>
|
||||
<td><input type="submit" value="Enviar"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
if(isset($_POST["nome"])){
|
||||
$nome = $_POST["nome"];
|
||||
}
|
||||
else{
|
||||
$nome = null;
|
||||
}
|
||||
|
||||
if(isset($_POST["mat"])){
|
||||
$mat = $_POST["mat"];
|
||||
}
|
||||
else{
|
||||
$mat = null;
|
||||
}
|
||||
|
||||
if(isset($_POST["n1"])){
|
||||
$n1 = $_POST["n1"];
|
||||
}
|
||||
else{
|
||||
$n1 = null;
|
||||
}
|
||||
|
||||
if(isset($_POST["n2"])){
|
||||
$n2 = $_POST["n2"];
|
||||
}
|
||||
else{
|
||||
$n2 = null;
|
||||
}
|
||||
|
||||
if($nome != null and $mat != null and $n1 != null and $n2 != null){
|
||||
echo"<p>O(a) aluno(a) $nome Matrícula $mat obteve as notas $n1 e $n2</p>";
|
||||
|
||||
$m = ($n1 + $n2) / 2;
|
||||
if($m >= 6){
|
||||
echo"<p class='verd'> Aprovado com média $m</p>";
|
||||
}
|
||||
else{
|
||||
echo"<p class='verm'> Reprovado com média $m</p>";
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo"<p>Preencha todos os campos para ver o resultado do aluno</p>";
|
||||
}
|
||||
|
||||
//echo"<h1><span class='azul'> Olá Mundo!</span></h1>";
|
||||
?>
|
||||
</main>
|
||||
<footer><h1>Programação WEB II - Prof. James Willian</h1></footer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user