- Joined
- Oct 20, 2010
- Messages
- 1,182
- Reaction score
- 515
The classic, code works no idea why, vs code doesn't work, no idea why.
Just seeking a fresh pair of eyes. All help is appreciated
Just seeking a fresh pair of eyes. All help is appreciated
Code:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
PHP:
<html>
<body>
<?php
function writeName() {
$fname = $_POST["fname"];
echo $fname;
$age = $_POST["age"];
if ($age < 21) {
echo $age;
echo "Katty Perry is Dank";
} else {
echo $age;
echo "Dank fuel can't melt jet memes";
}
}
echo "My name is ";
writeName();
?>
</body>
</html>