<?php
$g = $_GET['e'];
$t = "Title!";
$h = "";
$p = "";
function errorput($et,$eh,$ep) {
$t = $et;
$h = '<h1>'.$eh.'</h1>';
$p = '<p>'.$ep.'</p>';
}
if ($g == "nodata") {
errorput("Missing Something...", "Blank Field", "You left a box or few empty.");
} elseif ($g == "nopass") {
errorput("Password Incorrect!", "Encrypted Hash Unmatched", "Your password is probably wrong.");
} else {
errorput($t, "I have no idea.", "There was an error, but we don't know why.");
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $t ?></title>
<head>
<body>
<?php echo $h; echo $p; ?>
</body>
</html>
So, it outputs html based on what it receives via GET.
Why doesn’t it work?
$t and others aren’t in global scope. Return them.