I’m a beginner in PHP. 2 days ago I write few lines of code that was working, but yesterday, it wasn’t anymore. The code was:
<body>
<form method='post' action='test.php'>
name <input type='text' id='txtName'/>
age <input type='text' id='txtAge'/>
<input type='submit'/>
<hr/>
name <?php echo $_POST['txtName']; ?>
age <?php echo $_POST['txtAge']; ?>
</form>
</body>
What it does is only to show the value of text boxes, but it’s not working. Why?
Use name attribute on your input tags not ID for your php post variables: