Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

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

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
sieglej
Asked:
sieglej
  • 5
  • 4
  • 3
  • +2
1 Solution
 
knightEknightCommented:
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
 
sieglejAuthor Commented:
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
 
brunoCommented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
webwomanCommented:
"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
 
webwomanCommented:
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
 
sieglejAuthor Commented:
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
 
knightEknightCommented:
if that is the case, you can probably test it by renaming the .inc to .vb
0
 
brunoCommented:
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
 
sieglejAuthor Commented:
That didn't seem to help - don't know what the deal is...
0
 
brunoCommented:
i dunno about .vb, i would have recommened changing it to ".asp"
0
 
webwomanCommented:
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
 
sieglejAuthor Commented:
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
 
COBOLdinosaurCommented:
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
 
brunoCommented:
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
 
COBOLdinosaurCommented:
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
 
sieglejAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 5
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now