PHP Program to display user name
Program
<!DOCTYPE html>
<html>
<head>
<title>Display UserName</title>
</head>
<body>
<form method="post">
<h2>Please input your name:</h2>
<input type="text" name="name">
<button type="submit">Submit</button>
</form>
<?php
if (isset($_POST['name'])) {
$name = $_POST['name'];
echo "<h3> Hello $name </h3>";
}
?>
</body>
</html>
Output
Enter the user name

Displayed user name
