Web Design and Development Forums

Trouble with Server Side Includes

This is a discussion on "Trouble with Server Side Includes" within the ASP Forum section. This forum, and the thread "Trouble with Server Side Includes are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Jan 18th, 2007, 23:26   #1 (permalink)
Reputable Member
 
BGarner's Avatar
 
Join Date: Oct 2006
Location: In front of the computer.
Posts: 260
Trouble with Server Side Includes

I'm using ASP, but I think my problem can be solved with PHP, so feel free to move this moderators.

Okay, down to business. I am currently using the command <!--#include virtual="navbar.inc" --> to insert my navigation into my page. That works great on the home page, but the problem lies in how the file must be called. The include virtual command requires that the file navbar.inc be called using a relative URL.
Example

If the site using the command is... "www.mydomain.com"
...then in order to call... "www.mydomain.com/navbar.inc"
...I input...
<!--#include virtual="navbar.inc" -->
...at "www.mydomain.com"
BUT!!! (and here's my question) what if I want to divide my site up onto folders as most web designers do.
Now the site using the command is...
"www.mydomain.com/chocolate_rules"
...but I want to use the same navbar.inc file at...
"www.mydomain.com/navbar.inc"

Now, inputting <!--#include virtual="navbar.inc" --> yields the file at...
"www.mydomain.com/chocolate_rules/navbar.inc"
...which is non-existant
ASP is picky and won't allow an absolute URL, it must be relative. I want more than one folder, so linking up from the home page works only on the home page and in one folder. Can someone tell me how to take "mydomain.com/chocolate_rules" and include the xhtml at "mydomain.com/navbar.inc"

Thanks!
__________________
If a word in the dictionary were misspelled, how would we know?
BGarner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 19th, 2007, 02:34   #2 (permalink)
New Member
 
Join Date: Feb 2006
Location: Australia
Age: 37
Posts: 2
Re: Trouble with Server Side Includes

I always try to use virtual includes, but i always makesure it in including relative to the root directory of my website, by putting a / before the filename:
Code: Select all
<!--#include virtual="/navbar.inc" -->
By doing this, i can keep all my included file in a common place (normally a folder named common in my case) and then include them like this:
Code: Select all
<!--#include virtual="/common/navbar.inc" -->
This will work for including files from any directory in your website - you just have to know the path to the file starting in the root directory.

HTH
Alex
alexk13 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 19th, 2007, 21:26   #3 (permalink)
Reputable Member
 
BGarner's Avatar
 
Join Date: Oct 2006
Location: In front of the computer.
Posts: 260
Re: Trouble with Server Side Includes

Okay,

I tried it and it's not working for me. I am using the domain www.ldstroop21.org I input <!--#include virtual="/common/navbar.inc" --> and you can see it at...

www.ldstroop21.org/common/navbar.inc

but look...

www.ldstroop21.org/site.php

The navigation (white bar across the screen) is empty. No error message or anything.
__________________
If a word in the dictionary were misspelled, how would we know?

Last edited by BGarner; Jan 19th, 2007 at 21:27. Reason: Fixed broken link
BGarner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 20th, 2007, 17:16   #4 (permalink)
Reputable Member
 
BGarner's Avatar
 
Join Date: Oct 2006
Location: In front of the computer.
Posts: 260
Re: Trouble with Server Side Includes

Haha,

Wow I am dumb. I had tried your idea before, but It never worked. I just realized that I should probably name the extention to shtml for it to work. lol. Thanks for your help anyways!
__________________
If a word in the dictionary were misspelled, how would we know?
BGarner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
asp, server side includes, ssi

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java server side technologies asim Webforumz Cafe 0 Jun 20th, 2007 07:47
Server side executables Donny Bahama PHP Forum 4 Dec 30th, 2006 17:59
Client-Side VS Server Side Scripting redev2006 JavaScript Forum 1 Jul 30th, 2005 19:30
do server side includes affect performance? spinal007 ASP Forum 13 May 5th, 2004 12:34
ASP Include Files (SSI or Server Side Includes) administrator ASP Forum 3 Aug 15th, 2003 13:51



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 07:11.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59