Solved

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

Posted on 2002-03-18
16
218 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
"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
Comment Utility
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
Comment Utility
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
Comment Utility
if that is the case, you can probably test it by renaming the .inc to .vb
0
 
LVL 18

Expert Comment

by:bruno
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

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

Expert Comment

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

Accepted Solution

by:
webwoman earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Swiper slider stops between pages 11 30
Image not there 4 33
using web browser with BING 40 84
CSS grid style change 2 13
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
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 add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

744 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

17 Experts available now in Live!

Get 1:1 Help Now