Question

This is my first time using php. I am having a little trouble starting out simple such as just printing "hello world" through php inside an html document. I have an html document with various elements in it and when I print

  <?php echo "hello world" ?>

The html document won't accept the php tags. I have read that html docs won't accept php tags, if this is true how do I integrate php and html? If I just use a php file aptana won't allow me to preview the document.

No correct solution

OTHER TIPS

Change the file extension from HTML to PHP. View it in the browser instead of inside Aptana. Also add a semi-colon to the end of the string.

<?php echo "Hello World"; ?>

It sounds like you need to read a really basic tutorial on setting up a webserver locally by the way.

XAMPP is pretty popular so take a look at this guide: https://www.udemy.com/blog/xampp-tutorial/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top