Using a PHP include - works in...

User 1941307 Photo


Registered User
19 posts

I'm trying to do a php include using the following...

<?php include("includes/menu.php"); ?>


where menu.php is saved in a folder called "includes" under my root directory. It looks good when done in Notepad and uploaded to my server, but when I open the same file, index.php, in HTML Editor, and click the Preview tab, the menu isn't there.

Thoughts?

Ryan Clark
User 46819 Photo


Registered User
31 posts

Ryan,

Your PHP script needs to be run from a PHP-enabled server in order for you to see what the output will look like.

I installed WampServer on my local drive and this allows me to view the PHP pages in the HTML editor. The installation is easy and documentation is available to tweak the settings. You can except the default settings, which is sufficient to view your pages.

http://www.wampserver.com/en/

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.