HTML não pega variável de PHP
Aqui a pagin asolicita dois numeros para somar
entrada.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Entrada</title>
</head>
<body style="background:#110788">
<div >
<form method = "get" action="soma.php" >
<center><h1><br/>Digite um valor</h1><center>
<input name = "v1"/>
<center><h1><br/>Digite outro valor</h1><center>
<input name = "v2"/>
<input type="submit" value="resultado"/>
</form>
</div>
</body>-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
soma.php
Aqui eu faço a soma
<?php
$n1 = $_GET ["v1"];
$n2 = $_GET ["v2"];
$soma = $n1+$n2;
?>
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
Aqui eu queria que o HTML mostrasse em nessa página o resultado, tentei usar output, request com PHP interno e usando o link da pagina, tentei setar com php mas nada deu certo mas nehuma das formas deram certo
saida.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>saida</title>
</head>
<body style="background:#110788">
<div >
<form method = "get" action="soma.php" >
//é nesta parte que não sei como resolver
<form method = "get" action="soma.php" >
<center><h1>A soma eh</h1><center>
<input name = "$soma"/>
</form>
</div>
</body>
</html>
Se alguem souber de algo da um help aí
Obrigado
Discussão (7)
Carregando comentários...