Server Side Includes and //Localhost...

User 2034657 Photo


Registered User
64 posts

Hi all,

I am using the Editor and CSS menus. Rather than cut and paste the menu html code into every page, I want to use Server Side Includes (SSI) for inserting menu code into each page. To test the SSI, I have learned that I can only test by going "live" at the host site.

Question: To test the SSI, can I use //localhost on my development machine for testing a website in development including the SSI? I have tried to set up a new Server (//localhost) in the Editor, but I've had no success. I believe the user ID for //localhost is "root", and I have not set a password for access. I'm probably overlooking something technical here.

I would appreciate any suggestions you may have. Thanks, in advance.

John H.
________________________________
A good mind is like a sponge in water.
User 562592 Photo


Registered User
2,038 posts

No, you are not able to do that. You can only test it on a live server. If you need help with the include I have a tutorial on my website:

www.innovatewebdevelopment.com/support.shtml

Good luck
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 184085 Photo


Ambassador
1,707 posts

I run WAMP on my windows box, and the directory /wamp/www is the default localhost directory.

So my file index.php pulls in my menu from the file menu.html using

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


the entire page (less header)

<body>
<div id="main_container" class="curved shadow">
<img src="image_banner/banners/rotate.php" width="800" height="200" alt="Virtual international Flying Club" title="Virtual International Flying Club" />
<div id="menu_box"><?php include("menu/menu.html"); ?></div>
<div id="main_content">
<div id="content_1">
<?php include("content/main_page.html"); ?>
</div> <!-- close content 1 -->
<div id="content_2" class="curved">
<?php include("content/calendar.html"); ?>
<?php include("content/teamspeak.html"); ?>
<?php include("content/vatsim.html"); ?>
</div> <!-- close content 2 -->
</div> <!-- close main content -->
<?php include("footer/footer.php"); ?>
</div> <!-- close main container -->
</body>


so i "compartmentalized" the code, and pull in the modules I need to assemble a page.

If your localhost is running PHP then go for it.
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 509544 Photo


Registered User
7 posts

John,

You need to be running some form of web server (apache, WAMP, etc.) that can process the include request by gathering up and compiling the include files into a single page rendering.

With the imbedded FTP functions in the HTML Editor, sending the page to your web host shouldn't be that big a deal to test your work externally.

I use the same approach for all my larger sites (i.e. headers, menus, footers are all SSI files for easier site editing.) I used to have a localhost web server but found the overhead was not worth the small savings in development testing time.

Dave

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.