Q:

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

belongs to collection: PHP basic programs with examples

0

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

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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:

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a PHP script to get the client IP address... >>
<< Write a PHP script to display ‘Hello World!’...