I'm very new to php/html, and I'm trying to teach myself the basics of creating and processing an html form.
I created a folder called Website. In it I created an html file index.html. I also created a file submit.php.
(this code is taken from: http://www.w3schools.com/php/php_forms.asp)
In index.html I have:
<html>
<body>
<form action="submit.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
</body>
</html>
In submit.php I have:
<html>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
</body>
</html>
When I open the html file in chrome and fill in the blanks and press submit, I get redirected to a page with the code in submit.php:
<html>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
</body>
</html>
I should be getting this output:
Welcome Hannah
Your email address is Hannah@example.com
What am I doing wrong that the output isn't working? Thanks!