include file

Results 1 to 5 of 5

Thread: include file

  1. #1
    Join Date
    Dec 1969

    Default include file

    How can I prevent user to see what is in my include files.<BR>e.g.I have in my page &#060;!--#include file="validation.asp"--&#062;,user can just type "" and see how validation works.Can I avoid it?<BR>Thanks in advance.

  2. #2
    Karl Guest

    Default RE: include file

    If they go to the page, they won&#039t see the contents of validation.asp, as IIS or PWS will pass the page through asp.dll and render it to pure html.<BR><BR>so your code will be safe. In fact, that&#039s why you should name your include files .asp<BR><BR>Karl<BR>

  3. #3
    Join Date
    Dec 1969

    Default I don't think so

    Ok,when you get htm page(of include file) you still can go to View,Source and see the code.Any ideas how to avoid it?

  4. #4
    karl Guest

    Default RE: I don't think so

    But all you see is the HTML, you don&#039t see any ASP.<BR><BR>There&#039s nothing more you can do about it. <BR><BR>Karl

  5. #5
    Join Date
    Dec 1969

    Default Preventing *any* other use of an include file...

    It&#039s easy.<BR><BR>In your *MAIN* files, do something like this:<BR><BR>&#060;% CONST AllowUse = "Zyzygy" %&#062;<BR>&#060;!--#include file="validation.asp"--&#062;<BR><BR>And then in your included file, do something like this:<BR><BR>&#060;%<BR>If AllowUse &#060;&#062; "Zyzygy" Then Response.Redirect ""<BR>%&#062;<BR><BR>Just be sure you haven&#039t written out the HTTP headers before you do the include. Presto.<BR><BR>(Of course, the other answer is also correct: If you have nothing but ASP code in the include file, then only the HTML that *IT* generates will be visible to the person who tries to use it.)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts