First I enter two values, then I must show the missing value on another screen. How can I make it so that it only shows me a result?
<!DOCTYPE html>
<html>
<head>
<!--sen-->
<title>formulario2.2</title>
</head>
<body background="https://i.pinimg.com/originals/65/c3/fa/65c3fa41b8f7339d4f47d30e82dc32d0.gif">
<?php
$senn = $_POST['senn'];
$co = $_POST['co'];
$hip = $_POST['hip'];
$resultado_sen = $co / $hip;
echo "<br>" . "<fieldset>" . "<h2>" . "<code>" . "<center>" . "El seno mide: " . $resultado_sen . "</center>" . "</code>" . "</h2>"."<br>" . "<br>" . "</fieldset>";
$resultado_co = $hip * $senn;
echo "<br>" . "<fieldset>" . "<h2>" . "<code>" . "<center>" . "El cateto opuesto mide: " . $resultado_co . "</center>" . "</code>" . "</h2>"."<br>" . "<br>" . "</fieldset>";
$resultado_hip = $co / $senn;
echo "<br>" . "<fieldset>" . "<h2>" . "<code>" . "<center>" . "El cateto opuesto mide: " . $resultado_hip . "</center>" . "</code>" . "</h2>"."<br>" . "<br>" . "</fieldset>";
?>
</body>
</html>
This is the javascript code
function sen(){
window.location.href="index2.2.html";
var co = document.getElementById('co').value;
var hip = document.getElementById('hip').value;
var senn = document.getElementById('senn').value;
if (co== "" || hip== "" || senn== "") {
alert ("achu, los datos son obligatorios achu!");
return false;
}
}
this is what html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script type="text/javascript" src="funciones4.js"></script>
<link rel="stylesheet" type="text/css" href="estilo4.css">
<title>Practica 2.4</title>
</head>
<body bgcolor="transparent">
<div class="index2.2">
<marquee>ENCONTRAR SEN</marquee>
<form name="formulario2.2" action="formulario2.2.php" method="POST" id="formulario2.2">
<center>
<fieldset>
<label>Sen</label>
<input placeholder="Escribe algo porfa" type="number" name="senn" id="senn"><br><br>
<label>Cateto opuesto</label>
<input placeholder="Escribe algo porfa" type="number" id="co" name="co" ><br><br>
<label>Hipotenusa</label>
<input placeholder="Escribe algo porfa" type="number" id="hip" name="hip"><br><br>
<button style="width:50%" id="seno" onclick="sen()">MOSTRAR</button>
</fieldset>
</center>
</form>
</div>