iframe src file

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,
My web site has two top level holders

database/
wwwroot/

All web files is under wwwroot/ folder.
database/ folder can not be accessed from browser.
I have a file(page1.asp) with iframe tag. I save it under wwwroot/.
And page2.asp is been saved under database/.

database/page2.asp
wwwroot/page1.asp

I write a link in page1.asp,
<iframe width="200" id="idCon" height="200"
src="../database/page2.asp"></iframe>
but it doesn't work. I also try
<iframe width="200" id="idCon" height="200"
src="D:\inetpub\..\..\database\page2.asp"></iframe>
it doesn't work too.
If I move page2.asp to wwwroot/ folder, it is fine.
For the security reason, I want my file keep in database/ folder.
Anyone can help me.
Thanks,
 
Hi Mark,
as you've said yourself files in database are not accessible from the web.
The only way to get the file would be to read it in with file system object,
eg
<%
set oFso = createobject("scripting.filesystemobject")
set f = oFso.opentextfile("D:\inetpub\database\page2.asp")
response.write f.readall
%>
 
It doesn't work when I put it in the src file.

<iframe width="200" id="idCon" height="200"
src="<%
set oFso = createobject("scripting.filesystemobject")
set f = oFso.opentextfile("D:\inetpub\mycompany.com\database\page2.asp")
response.write f.readall
%>"></iframe>





Jon Spivey said:
Hi Mark,
as you've said yourself files in database are not accessible from the web.
The only way to get the file would be to read it in with file system object,
eg
<%
set oFso = createobject("scripting.filesystemobject")
set f = oFso.opentextfile("D:\inetpub\database\page2.asp")
response.write f.readall
%>
 
Mark,

Having page2.asp in your web is not a security issue, however having it in
the /database folder dose provide a hacker with the path to your database
location.

Why do you think having the page2.asp in your web is a security issue?

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Mark,
Make a new page containg this code
<html>
<head>
</head>
<body>
<%
set oFso = createobject("scripting.filesystemobject")
set f = oFso.opentextfile("D:\inetpub\mycompany.com\database\page2.asp")
response.write f.readall
%>
</body>
</html>

Save this as GetPage2.asp. Now point your iframe to this page
<iframe width="200" id="idCon" height="200" src="GetPage2.asp">
</iframe>

Not sure I understand why you're wanting to do this - but that's how to do
it

--
Cheers,
Jon
Microsoft MVP - FP


Mark said:
It doesn't work when I put it in the src file.

<iframe width="200" id="idCon" height="200"
src="<%
set oFso = createobject("scripting.filesystemobject")
set f = oFso.opentextfile("D:\inetpub\mycompany.com\database\page2.asp")
response.write f.readall
%>"></iframe>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Page with Iframe 3
iframe link 1
Page format 1
iframe fowards to actual target 3
iframe page grabs whole screen 5
How to change iframe src ? 1
SWF Player IFrame PHP 0
I don't remember.... 8

Back
Top