Solved

<SCRIPT src=".."> can't find file

Posted on 2002-03-18
16
223 Views
Last Modified: 2012-06-22
I'm using some corporate code that uses the SCRIPT tag to include VB script files e.g.->  
  <SCRIPT language="VBScript" src="Cipher.inc" runat="server"></SCRIPT>

My code that uses those files doesn't work because the code isn't getting included properly, even in all the code is in the same directory.  The code can be found if I change the references to use
   <!-- #include file="Cipher.inc -->
style includes. Unfortunately, I have to stick with their implementation.  Their style works on Windows 2000 servers but not on my NT 4.0 server.  What can be done with my NT 4.0 system to make this work?
Thanks!
0
Comment
Question by:sieglej
  • 5
  • 4
  • 3
  • +2
16 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 6878347
Is this code intended to run on the browser or on the server?  If on the browser, then remove the runat="server"

<SCRIPT language="VBScript" src="Cipher.inc"></script>

If on the server, then you may want to remove the <% and %> from the top and bottom of the file if you want to use the script tag to include it.
0
 

Author Comment

by:sieglej
ID: 6878387
It's supposed to run on the server and there are no <% %> tags in the file being included.  I only use the <% %> tags if using the <--! include....  --> style. Something else?
Thanks.
0
 
LVL 18

Expert Comment

by:bruno
ID: 6878947
perhaps their server is set up to parse ".inc" files, but your server is not.
 therefore, their code is being parsed in the include file and being run on the server, but your file is not.


BRUNO
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 19

Expert Comment

by:webwoman
ID: 6879926
"The code can be found if I change the references to use
  <!-- #include file="Cipher.inc -->"

Then do that, that's the standard way to use server side includes. Their 'implementation' is useless if it doesn't work.

If they don't like it, tell them they have two choices:
Do it your way and have it work.
Do it their way and have it NOT work.

I've got Win2K servers, and YOUR way works just fine, that's what I use. Don't know about theirs. ;-)
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6879931
Wait, this might be it.
Ask them if they use InterDev. Bet they do, I've seen that construction in InterDev files.

Ask them if they can code anything themselves, or if they're so totally dependent on MS crap that they can't tell standard ASP constructions anymore.

On second thought, you might not want to do that... ;-)
0
 

Author Comment

by:sieglej
ID: 6880089
Not sure how they would set up a server to parse the inc files. What do you mean by that, Bruno?  We are trying to run the same app with the inc files.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6880102
if that is the case, you can probably test it by renaming the .inc to .vb
0
 
LVL 18

Expert Comment

by:bruno
ID: 6880235
sieglej,

some files are normally set up to be parsed....

.asp, .shtml

some are not

.html, .inc, etc


so if the code needs to be parsed to run, and the server is not parsing the file before sending it to the browser, the code is not going to run.  

But you can set up your server to parse any files you want...sometimes people do that to make dynamic files look as if they are only regular .html files


BRUNO
0
 

Author Comment

by:sieglej
ID: 6880825
That didn't seem to help - don't know what the deal is...
0
 
LVL 18

Expert Comment

by:bruno
ID: 6880886
i dunno about .vb, i would have recommened changing it to ".asp"
0
 
LVL 19

Accepted Solution

by:
webwoman earned 100 total points
ID: 6882764
If the page runs asp code, it should be .asp. Even if it's an include, it should still be .asp. You can have asp included in an asp page. I do it all the time.

The asp page would still be set up like a normal asp page, with the proper <% %> tags.

This is from MS... and it's specified as IIS 5.1 -- so if you don't have that, it's probably NOT going to work. Please note that it says OCCASIONALLY, it's at the very end of the article, and therefore, IMHO is NOT the recommended way to run included server side scripts.

"Occasionally, it may be desirable to include a server-side file by using the HTML <SCRIPT></SCRIPT> tags. For example, the following script includes a file (by means of a relative path) that can be executed by the server:

<SCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="Utils\datasrt.inc"></SCRIPT>
The following table shows the correct syntax for including files with the SRC attribute by means of either virtual or relative paths:

Type of Path Syntax Example
Relative SRC="Path\Filename" SRC="Utilities\Test.asp"
Virtual SRC="/Path/Filename" SRC="/MyScripts/Digital.asp"
Virtual SRC="\Path\Filename" SRC="\RegApps\Process.asp"

Note   You should not put any programmatic logic between the <SCRIPT> tags when including by this method; use another set of <SCRIPT> tags to add such logic."

0
 

Author Comment

by:sieglej
ID: 6897939
This is why it may work on Win2K servers and not NT4 servers - if it's an IIS version thing.  I'll have to use their code as is for the time being (groan) and test on a Win2K server....
Thanks,
Jeff
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6975497
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 6976103
sieglei,

you were the last to comment, but no experts after you.  Did you still need help on this?  You made it sound as if you were going to test something and get back to us...


BRUNO
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7003652
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
split brunobear, webwoman and knightEknight

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 

Author Comment

by:sieglej
ID: 7006157
Sorry, I thought I'd accepted WebWoman's comment as an answer quite a while ago (I'm just running it on W2K) - not sure what happened....
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question