I'm studying PHP (so I'm a rookie). I'm working on a PC (windows 7) with XAMPP, Apache.
I have two files exampleform.html:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
and welcome.php:
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
I created those 2 files and worked well. On Monday I encountered the problem that upon clicking the buttom summit query it would show me the code instead the result. I searched few forums and found I need to add the following lines to httpd.conf (xampp/apache/conf/):
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .php
Then it worked. Today when I try again it shows me the code once more. Please help. It can't be so complicated!