Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Monday, February 6, 2023

Create a simple HTML form and accept the user name and display the name through PHP echo statement.

 

<!DOCTYPE html>

<html>

<head>

<title></title>

<meta http-equiv="Content-Type"  content="text/html;  charset=UTF-

</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>

 


No comments:

Post a Comment