0

Apologies if this is a real simple problem, but I'm new to this!

I am creating a form here is what I have so far:

<form action="index.php" method="POST">
    <div class="header">Personal Details</div>
    <input type="text" name="name" id="name" placeholder="Name">
    <input type="text" name="email" id="email" placeholder="Email">
    <input type="text" name="department" id="department" placeholder="Department">
    <input class="btn" type="submit" value="Submit">
</form>

I then have an index.php file which currently looks like this:

<?php

    echo $_POST['name'];

?> 

Then when clicking 'Submit' index.php loads however it just displays as per above php code, and it doesn't spit out the name which has been input.

Any help would be much appreciated!

Kind Regards Adam

Adam
  • 3
  • 2
  • 2
    Are you sure that php has been installed wherever you're trying to execute this? – Blake Aug 13 '15 at 15:43
  • 1
    Where do you have your files? PHP needs to be run from a server to actually respond, otherwise it's just a text file, and your browser will treat it as one. – samlev Aug 13 '15 at 15:43
  • 2
    possible duplicate of [PHP code is not being executed (I can see it on source code of page)](http://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-i-can-see-it-on-source-code-of-page) – Don't Panic Aug 13 '15 at 16:03

0 Answers0