Jump to content

Recommended Posts

ya toy en xammp y tngo este codigo y no funka xD

el html

<html>

<body>

 

<form method="post" action="triangulo.php">

 

BASE<input type="text" name="base">

<br>

ALTURA<input type="text" name="altura">

 

<p>

<input type="Submit" name="Submit" value="Calcular">

</form>

</body>

</html>

 

y el php

 

 

<html>

<body>

 

<?php

$base ;

$altura;

$area = ($base*$altura)/2;

 

printf("area del triangulo es: $area");

 

?>

 

 

 

 

</tml>

</body>

 

 

kien me korrige porfa :D

 

 

Link to comment
Share on other sites

Probado y funcionando :D

HTML

<html>
<body>

<form method="post" action="areatriangulox.php">

BASE:
    <input type="text" name="base" id="base">
  <p>ALTURA:
    <input type="text" name="altura" id="altura">
<p>    <input type="Submit" name="Submit" value="Calcular">
</form>
</body>
</html>

PHP

<?php
$base = $_POST['base'];
$altura = $_POST['altura'];
$area = ($base * $altura)/2;
echo "area del triangulo es: $area";
?>

 

 

SALUDOS!

Edited by tomy321
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...