Ok i'm new to php.Here is what i'm trying to do. Here is my index.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>
I'm posting to welcome.php
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br>
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
But instead of showing up the page, it downloads welcome.php
Make sure the server has PHP installed. If you have PHP installed, try restarting your server.
If you are using Ubuntu/Linux you can install via terminal:
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-mcrypt mysql-server libapache2-mod-auth-mysql php5-mysql
Make sure that PHP is enabled on your server.
If it is not enabled: check the documentation that came with your server software.
If PHP is not supported with your software: You should download software similar to WAMP Server
WAMP is an Apache server combined with Mysql and PHP for the Windows operating system
(Windows-Apache-Mysql-PHP)