Create a HTML form that accept the user name and display the name using php

Introduction

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..

<!DOCTYPE html>
<html>
<head>
   <title>PHP Excercise</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   </head>
   <body>
   <form method='POST'>
   <h2>Please input your name:</h2>
 <input type="text" name="name">
 <input type="submit" value="Submit Name">
 </form>
<?php
//Retrieve name from query string and store to a local variable
$name = $_POST['name'];
echo "<h3> Hello $name </h3>";
?>
</body>
</html>

Result

Create a HTML form that accept the user name and display the name using php
Create a HTML form that accept the user name and display the name using php

Leave a Comment