<?php
if( $_GET["fname"] || $_GET["lname"] ) {
echo "Your first name is ". $_GET['fname']. "<br>";
echo "Your second name is ". $_GET['lname'];
exit();
}
?>
<html>
<body>
<form action = "<?php $_PHP_SELF ?>" method = "GET">
First Name: <input type = "text" name = "fname" />
Last Name: <input type = "text" name = "lname" />
<input type = "submit" />
</form>
</body>
</html>
Output: