Skip to content

Commit

Permalink
Exemplos PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronneesley committed Aug 22, 2024
1 parent 721f109 commit d3140ab
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
9 changes: 9 additions & 0 deletions exemplos/php/fisica/conversor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

$C = $_POST["temperatura"];

$F = 1.8 * $C + 32;

echo "A temperatura em graus Fahrenheit é: $F";

?>
18 changes: 18 additions & 0 deletions exemplos/php/fisica/temperatura.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Conversão de Temperatura</title>

<meta charset="utf-8">
</head>

<body>
<form method="post" action="conversor.php">
<label>Temperatura (° C)</label><br />
<input type="number" name="temperatura" />
<br /><br />

<input type="submit" value="Converter" />
</form>
</body>
</html>
10 changes: 10 additions & 0 deletions exemplos/php/matematica/hipotenusa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

$b = $_POST["base"];
$a = $_POST["altura"];

$h = sqrt( pow($a, 2) + pow($b, 2) );

echo "Hipotenusa: $h";

?>
21 changes: 21 additions & 0 deletions exemplos/php/matematica/triangulo_retangulo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>

<h1>Cálculo da Hipotenusa</h1>

<form method="post" action="hipotenusa.php">
<label>Base</label><br />
<input type="number" name="base" />
<br /><br />

<label>Altura</label><br />
<input type="number" name="altura" />
<br /><br />

<input type="submit" value="Calcular Hipotenusa" />
</form>
</body>
</html>

0 comments on commit d3140ab

Please sign in to comment.