|
-
Nov 5th, 2001, 02:02 AM
#1
Thread Starter
Addicted Member
Serverside Scripting and the include function
Ok,
I am having a little bit of trouble. I am unable to get the include function to work. I am running IIS 5, should this still work. Any assistance in the matter is much appreciated.
Jeremy
-
Nov 5th, 2001, 05:26 AM
#2
Hyperactive Member
what error messages are you getting?
and how are you calling them?
-
Nov 7th, 2001, 08:46 AM
#3
Thread Starter
Addicted Member
Error
I am not getting an error on the server or the client, the included pages simply does not display.
Any ideas?
-
Nov 7th, 2001, 09:07 AM
#4
Hyperactive Member
Make sure that
1. The file that has the includes in has the extension .shtml
2. The files you are including have the extension .html
If the above two have been done then it is your server that is incorrectly configured!
View source on the page and look if the
include line:
<!--#include virtual="your file.html"-->
is there.
if it is then it is not being interpreted by the server.(Check your server config!!)
This should help!
-
Nov 7th, 2001, 09:42 AM
#5
Frenzied Member
Wow... I'm using .inc for included file extensions. It is working on every machine we've tried it on save one, and that one is running ASD.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Nov 7th, 2001, 09:51 AM
#6
Hyperactive Member
ASD ??
I don't think it matters what the included file is called i just said .html as an example cos i know that works!
-
Nov 7th, 2001, 10:15 AM
#7
Black Cat
SSI shouldn't care what file extension you use for include files.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Nov 7th, 2001, 10:18 AM
#8
Hyperactive Member
thought as much!
-
Nov 7th, 2001, 10:42 AM
#9
Frenzied Member
ASD = Active Server Directory
We get permissions errors when an ASP tries to include a file that is in the same directory. It is only on that machine, and that machine is the only one running ASD. I don't have a clue what the problem is.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Nov 7th, 2001, 10:43 AM
#10
Thread Starter
Addicted Member
Ok
Ok if I use the extesion of shtml it works, is there anyway I can have this work for htm or html files?
Jeremy
-
Nov 7th, 2001, 10:44 AM
#11
-
Nov 7th, 2001, 10:48 AM
#12
-
Nov 7th, 2001, 11:19 AM
#13
Thread Starter
Addicted Member
Humm
Really don't have much of a choice, do you know where I can change these options?
Jeremy
Last edited by Jeremy Martin; Nov 7th, 2001 at 11:25 AM.
-
Nov 7th, 2001, 08:59 PM
#14
I too wouldn't do that. changing it so every htm or html extension is parsed as SSI will slow things down considerably, and/or might have troubles with that as well.
the file doing the include has to be .shtml and you can include anything like .inc or .txt or .html, that shouldn't matter.
but changing it will make the server work twice as hard.
why wouldn't you not have a choice?? it is easier to leave it as is and make the extension as .shtml. also if it is an ISP you might not be able to do that.
just my 2 cents
-
Nov 8th, 2001, 04:27 AM
#15
Hyperactive Member
to change the extension .html to be associated with SSI
1. go into control panel/computer management
2. find and expand the internet information services tree
3. right click on the website you wish to change the extensions on
4. click the home directory tab
5. click the configuration button
6. you will then see a list of extensions and there associated executables & dll's
from here you can edit them !
Don't take this as gospel but server side include technology isn't a very secure technology.
If you wish to templatise your pages you can use javascript templates. for example if you have a header that you want included on every page you can put it in a js file and do the following
Code:
#js file header.js
var header = "";
header+="<h1>my included javascript header</h1>";
#html page home.html
<html>
<head>
<script language="javascript" src="header.js"></script>
</head>
<body>
<script language="javascript">document.write(header)<script>
<h2>my content</h2>
</body>
<html>
This is a method i use on a regular bases, it can also be quite fast as the first time the js file is used by a user it is cached on there machine so for the rest of the site the html will be loaded in faster.
This method should be quicker than SSI as it is a clientside technology which is usually quicker than server side, and it won't slow your server down, and you can keep your pages with the .html extension!
Well there u go now you have two choices!
I recommend you give the js way a try before changing you server extensions
-
Nov 8th, 2001, 09:07 AM
#16
thanks progressive, never thought about doing it that way, engenious man purely engenious.
-
Nov 8th, 2001, 09:10 AM
#17
Hyperactive Member
-
Nov 8th, 2001, 11:22 AM
#18
Thread Starter
Addicted Member
JS Header
I was going to use the JavaScript header to display the header but the only problem is the page call a javascript function and has both types of quotes in it '," so that when I do a document.write the script is incomplete because the ' or the " terminates the string of the write function. I am really not to concerned with security as this site does not have a confidetial or secure information on it.
Jeremy
-
Nov 8th, 2001, 11:36 AM
#19
Frenzied Member
Code:
<script type="text/javascript">
document.writeln("I'm a JavaScript that can write \"s. Aren't I special?");
</script>
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Nov 8th, 2001, 11:37 AM
#20
Hyperactive Member
Thats easy all you need to do is escape the ' by putting \ infront of it
see the attachment!
-
Nov 8th, 2001, 11:48 AM
#21
Thread Starter
Addicted Member
True
This is true, the only problem is this header is a adobe golive document that has serveral floating text boxes and uses style sheets. When all is said and done this document is a lot of lines and to write the document as a javascript and reformat all the strings everytime something is updated would be an extrodinary job within its self. I was going to use the shared boarder option in FrontPage but frontpage doesn't handel all the dhtml correctly and rewrite the top boarder and then all kinds of script error occurs.
Jeremy
-
Nov 8th, 2001, 12:01 PM
#22
Hyperactive Member
-
Nov 8th, 2001, 01:15 PM
#23
Thread Starter
Addicted Member
HTML Software
Humm, that sounds pretty neat but I am restricted to FrontPage and GoLive because that is what is covered under out campus agreement.
Jeremy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|