Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2006, 07:42 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default No control over parent paths

Good Day

I have just struck a host that will not enable parent paths (iis 6.0 Win 2003) - What options do I have to allow the following files to be called?





from a page inside a folder one level in from root. I am aware of the include virtual syntax however have never used it and are having some difficulty getting it working. mmmmm...it seems to have me a little stumped.

Additionaly, Is enabling parent paths such as risk?

TYIA



Wind is your friend
Matt
__________________
Wind is your friend
Matt
 
Old December 17th, 2006, 08:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Matt,

You can use virtual instead of file and then feed it a virtual, root based path like this:





assuming that scripts is a folder in the root of the site.

Using parent paths can be a security risk. You could do something like this:



By blocking the possibility to go outside the root of the site, you can't access files that are not part of that site.

Proper NTFS permissions should minimize or complete avoid this problem though.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old December 17th, 2006, 05:31 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Hello Imar, thank you for your time...

Thats the syntax I was using, and how I thought it was supposed to be used. I spent a good half hour reading about it before I wrote the post.

Yes the scripts folder is at root level, however I get a:
HTTP 500.100 - The include file '/scripts/global.asp' was not found.
error. mmmm very annoying...

The global.asp file is present and it is in the scripts dir. This works locally:




The following fails locally and on the production server where parent paths are not, and can not be enabled (http://204.3.222.94/ un=admin, pw=admin):





I am doing a job and uploading to a host which is new to me. This is the first time I have been told parent paths can not be enabled. To make matters worse the Aussie hosting company has given me a box sitting in the US, showing not only US date format (which is fine of course) but US time also. Its dec 18th 8.30AM here and the server is showing 17th Dec 1.25PM - In your opinion would you try to ge the client a refund and change hosts or would you write a function tackling the nasty day light saving issue?

TYIA



Wind is your friend
Matt
 
Old December 17th, 2006, 06:39 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The error I get when I log in seems to suggest you're still using file references, or at least paths with ../ in it:

The Include file '../scripts/global.asp' cannot contain '..' to indicate the parent directory.

I think I would try to get a host in my time zone, but writing a function that fixes those problems isn't too hard either....

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old December 17th, 2006, 06:49 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

cheers for looking. I just got of the phone with the hosting company, they may enable parent paths, he has requested I place include file type syntax there for now. I must have just changed it back, sorry bout that, I very much appreciate you looking.

If I place (force au time zone):
Session.LCID = 3081
in the session_on_Start event inside a global.asa file, this should fix the time issue for each user per session? I am suspecting it should. We have a server at work that is AU time however mm/dd/yyyy date format. This LCID alters the date to dd/mm/yyyy for each session, please tell me it will alter the time also?

TYIA

Wind is your friend
Matt
 
Old December 17th, 2006, 06:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, it changes the format in which the date and time is displayed; not the actual date and time though.

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old December 17th, 2006, 09:01 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Does this mean if I do a query such as:
sql = "SELECT ...,... FROM gallery WHERE inactive=" & state & " AND expiry > #" & date() & "# order by updated desc;"

Since the server time is in excess of 12 hours behind us in aussie; I will still see the records which were due to expire, lets say five hours ago?

TYIA

Wind is your friend
Matt
 
Old December 18th, 2006, 02:27 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What it means is that Date() returns the current local date on the server.

So, if it's 11 a.m. on your side and 11 p.m. in the time zone where the server resides, Date() will always return 11 p.m.

So, yes, it's possible you end up with records that should have expired because the server thinks that time hasn't come yet....

Imar


 
Old December 18th, 2006, 06:01 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Looks like the host has not turned on parent paths, I have placed:



on the login page hoever get:

The include file '/scripts/global.asp' was not found.

While trying to login. The Scripts is a folder at root, as is the admin folder (location of the loginProcess page). Even locally I get the same behaviour, am I missing something?

TYIA


Wind is your friend
Matt
 
Old December 18th, 2006, 06:07 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

sorry I hadnt refreshed my browser properly. It works on the hosts server however the virtual type include fails locally. How can I eliminate having to use virtual on the server and file locally?

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find paths in visual C#? chobo2 C# 2008 aka C# 3.0 2 September 25th, 2008 11:12 PM
paths table FT BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 December 12th, 2006 11:50 AM
Filesystemobject and UNC paths dlfisher1972 Pro VB 6 0 January 5th, 2006 01:44 PM
Accessing parent control functions from child badgolfer VS.NET 2002/2003 2 January 9th, 2004 07:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.