0

I have a front end HTML code which I have used PHP to access the database and it worked well. The problem came when I used the same PHP code to access the same database but with different HTML frontend code. My php code appears grayed out on the editor, see the image

enter image description here

I am trying to access same database. whats the problem here

LivingstoneM
  • 735
  • 2
  • 13

1 Answers1

1

For php files use php extention like index.php you have index.html

How do I add PHP code/file to HTML(.html) files?

Ingus
  • 943
  • 8
  • 29
  • 1
    wow. Thank you, I was so focussed on code errors until I didn't think of the file extension. – LivingstoneM Dec 17 '19 at 06:57
  • If you are just going to reference another Stackoverflow question for the solution, this should be marked as a duplicate as it adds nothing to the original solution. – Nigel Ren Dec 17 '19 at 06:57
  • @LivingstoneM sometimes we miss small but important case :) – Ingus Dec 17 '19 at 06:59
  • If you look at the linked questions, there is a lot more information than just change the file extension. If I just answered every question that I close as a duplicate then I would get the bonus from that, but SO would be full of questions partially answered and don't have the benefit of the time spent on the duplicate. – Nigel Ren Dec 17 '19 at 07:10