I am trying to assign the value of text box to a variable in PHP. But I am consistently getting an error. The error says, "Undefined index: fname" and "Undefined index: age ". Can anyone please help me in this matter? How can I resolve this?
form action="welcome.php" method="post"> Name: <input type="text" name="fname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> Welcome <?php echo $_POST["fname"]; ?>!<br /> You are <?php echo $_POST["age"]; ?> years old.
Any help will be very much appreciated.
Bilal A. Khan