Código PHP:
<?php
$q="";
$m = isset($_POST["masa"])? $_POST["masa"]: '';
$sustancia = isset($_POST["sustancia"])? $_POST["sustancia"]: '';
$t1 = isset($_POST["t1"])? $_POST["t1"]: '';
$t2 = isset($_POST["t2"])? $_POST["t2"]: '';
$tf=$t2-$t1;
if ($sustancia=='H2O') {
$c=4180;
}
if ($sustancia=='AL') {
$c=2422;
}
if ($sustancia=='FE') {
$c=3537;
}
if ($sustancia=='CU') {
$c=3.45;
}
if ($sustancia=='HG') {
$c=1888;
}
else{
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'calorerror.html';
header("Location: http://$host$uri/$extra");
exit;
}
?>
Código PHP:
else{
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'calorerror.html';
header("Location: http://$host$uri/$extra");
exit;
}