0

Create a simple HTML form and accept the user name and display the name through PHP echo statement? This code isnt work😑

<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>hello everyone</title> </head> <body> <form method='POST'> <h2>Enter your name</h2> <input type="text" name="name"> <input type="submit" value="submit"> </form> <?php $name=$_POST['name']; echo "<h2>hello $name</h2>"; ?> </body> </html>

14th Dec 2019, 9:15 AM
Iqra Jannat
Iqra Jannat - avatar
2 Answers
0
You are posting something but you didn't mention to where. Add "action" to the "form" https://www.w3schools.com/tags/att_form_action.asp
14th Dec 2019, 9:24 AM
Mystic Life
Mystic Life - avatar
0
Create html code to display your name, department and include the following attribute background color, text formatting
3rd Sep 2023, 9:58 PM
Papa
Papa - avatar