Solved

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

Posted on 2002-03-18
16
221 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now