0

I'm a (very) amateur coder and am new here. I've literally been practicing coding for just a couple of months and have recently begun learning PHP for my new job.

So, I'm trying to create a page to test my code on but the PHP code seems to be showing on the page instead of being hidden.

Just FYI, i'm on an Apple Macbook Pro, using Brackets as my editor and running XAMPP 7.1.4-0 with the Apache server running. Currently using the Google Chrome browser.

My code is:

   <html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'; ?> 
 </body>
</html>

The code just produces the following (but without the speech marks):

"Hello World

'; ?>"

I would post a screenshot but it's not allowing me on here unfortunately.

I just want to know why that second line of code is appearing.

Please let me know if you need any more info, any help would be hugely appreciated!

Thanks in advance :)

Rob
  • 1
  • The file name should have the extension .php. Looks like the php is not being processed. – Jason K May 18 '17 at 21:06
  • To get a better idea of what is happening, could you edit the post and add the html source? That will make it easier to see if the php is being processed. – Tim Morton May 18 '17 at 21:09

0 Answers0