(Edited for clarification) I am trying to execute some PHP code in a file called "index.php" using the Apache web server in XAMPP. The file is located at C:\xampp\htdocs\index.php.txt (not sure how to get rid of the .txt suffix). I am accessing the file by typing "http://localhost/index.php.txt" into my browser. The code is:
<!DOCTYPE html>
<html>
<body>
<?php echo "It works!"; ?>
</body>
</html>
When I select the file in the Apache server only the code itself shows up. I've been searching around for a while and I can't seem to find the issue. Thanks in advance.