samedi 29 juillet 2017

HTML Shows PHP file as a plain text [duplicate]

This question already has an answer here:

I learn coding in my free time and I tried creating HTML website refering to PHP file. This is my HTML code:

     <form action = "prihlaseni.php" method = "POST" >
      <input type = "text" name= "uzivatel" placeholder = "uzivatelske jmeno">
      <br>
      <input type = "password" name= "heslo" placeholder = "heslo">
      <br>
      <button type = "submit">PRIHLASIT</button>
      <br>
      </form>

I read that it should call the PHP file and execute code in it. Here is my PHP file:

    <?php
 $uzivatel  = $_POST['uzivatel'];
 $heslo  = $_POST['heslo'];
 echo $uzivatel;
 echo $heslo;
?>

I thought that the website will show the text called "uzivatel" and "heslo", but it shows the code (up here) as a plain text. I am enclosing a picture of it: Here: Would you explain me why, someone? :) Thanks a lot for helping me and sorry if its some obvious mistake, I am just a begginer, maybe I will help you once.. ;)

Radek




Aucun commentaire:

Enregistrer un commentaire