Includes, Images & Sub Directories
I'm creating a site which will have the home page at the root level, but all of the sub pages in sub directories:
root/
-homepage.asp
-subdirectory/
subpage.asp
-images/
logo.gif
-includes/
header.asp
Each page of the site will have the include <!--#include virtual="/includes/header.asp" -->
header.asp is a table with our company logo, logo.gif. The problem I'm having is that subpage.asp does not display logo.gif because the path in the include is only correct at the root level.
I don't want to create multiple includes. Is there another way to make this work that I'm missing? Thanks!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Images In Include Used In Different Directories
I have an include file which contains some images. If I use this include in a sub directory, the path is obveously wrong. How can I sort this problem - is it best to just use absolute paths rather than relative?
Uploading Images/Creating Directories
I have only been developing small sites using asp and Access database. I want to advance my skills and develop a large site. Basically, I need direction in relation to having a user set up an acct., and once set up, being able to upload images. FrontPage (dare I say it) has always enabled me to allow visitors to upload one image at a time, and then only to a specific directory. What I want is the ability to have someone upload a specified amount of images to a directory that is created when they opened their account. ie., /tom/images If anyone knows of of good tutorials on this, I sure would appreciate it. I also want the ability to check images file size and dimesions, and resize or reject if neccessary. Can I learn how to do this w/out buying some program online.
Sub-directories
I know how to copy files from one location to another but how would I go about copying a file from one directory into serveral - or actually all subdirectories in a single action? Some kind of loop Basically I want to be able to enter a filename into a text field and click submit which would then copy the named file (which resides in the root directory) into every subdirectory under the root (1 level only). Would be helpful to be able to specify mutliple files to be copied at once.
Seeing Directories Using ObjFileScripting
I found this script on the web that I've adapated a little to see the files I put into a directory. However it doesn't see any sub directories. Does anyone have any idea how i can point to a directory and list everything, including the directories? Code:
Directories And Security
It's funny that this has not been invented yet, or has it?: You store your DB outside your default website. It is accessed only through your ASP code and a ODBC-connection. This way your DB is not obtainable for the web user. Why doesn't Any One create a connection corresponding to ODBC, lets call it FileConnect that in the same way allows us, in a web site, to have directories and files that are really hidden?
Virtual Directories
In php you can have a script like: http://localhost/page/parameter1/parameter2 where page is acually a php script and the script gets the parameters in $PATH_INFO I need something similar in asp. If possible without modifying any settings on IIS. Here is a tutorial on how to do it in php. http://www.zend.com/zend/spotlight/searchengine.php
Uploading To Different Directories
I am trying to set SA-Fileup to filter the files that are uploaded based on the name of file selected in the form. I am able to get it to work on Filetype, but I need it to do it on Filename is not Filetype. where I can find something on this?
Looping Through Directories
i have a subdomain on my works server that i use to store different stuff on, like different projects that i'm working on. They are all set up in their own folders, for example, sub.blah.com/project1, sub.blah.com/project2 etc etc. (all the folders have different names). What i want to do is to create an index page on sub.blah.com that will list out all of the folders. I dont have any access to the server workings so this all has to be done with a script.
Global.asa And Sub-directories
My global.asa maintains some stats for me. However when I put part of my site in a sub-directory it appears to run the global.asa file from the sub-directory when I am accessing content in that sub-directory. This makes all the paths specified in global.asa wrong. I can understand that it runs, since it is application driven and all sub-directories will be part of the same app, but I can't understand it running in a different directory to where is resides.
Reading Files And Directories
I have several files and directories and I want to read the contents, seperate them into fields and INSERT them into a database. The structure is as follows: D:DISCSSC8849SC8849-01 Artistname - title.zip D:DISCSSC8849SC8849-02 Artistname - title.zip D:DISCSLG114LG114-01 Artistname - title.zip I want to read every file in D:DISCS, seperate the filenames into: Disk Number, Track Number, Artist and Title - drop the .zip and the hyphens entirely and insert the data as a record in a database.
Including Menu In Certain Directories
I'm including a template on all pages in a site. In the template I have a menu. What I'd like is to have a different menu displayed if I'm in a different directory. Something along the lines of: If path is /mainsite Then Regular Menu If path is /admin Then Admin Menu Just not sure about how to go about getting there. My first thought was to use the PATH_INFO server variable, but that returns the page name too. Any suggestions?
Cookies And Virtual Directories
I'm having a problem with cookies in a virtual directory, A cookie is created by an ASP application in the root folder i.e. http://xxx.yyy.com I'm unable to read this cookie in a virtual directory i.e. https://xxx.yyy.com/mydirectory in a Visual Studio 2005 application. If I create the cookie in my virtual directory the application in the root directory reads the cookie without any issues.
Protecting Directories And Redirecting
Is there any way to setup a multiple password page where if user1 logs in it will take him to dir1 and if user2 logs in it will take him to dir2 and so on. Basically, we need a page that checks to see if the user name and password exists and then redirects accordingly.
List Directories But Not Subdirectories
I have managed to cobble this together And now I have got stuck with modifying it. What it does is provide an option box that allows you to choose any of the folders in a directory. The files in that directory are then listed below the option box. (the file structure dictates the order/grouping of the files) It change the path-to-directory with a manual option. Code:
Session In ASP For Two Virtual Directories
Can a session be good for two different virtual directories under the same site? They are for internal use only. Would the session be carried from the virtual directories? Site one is : http://fs1/review1/ Site two is: http://fs1/review2/
Username Lookup For Protected Directories
I need to look up what user name was used to login to a protected directory using ASP. I don't want to create a login page, etc. It shouldn't be necessary. Only employees who already have user accounts need to log in to the webapp and the protected directory login box is all the security I need. I just need to be able to access the username that they used in my application. Code:
ASP Includes?
As im used to using php im not to famillier with asp Is there such thing as a asp include? and how would i do it?
Includes
I have a folder structure that looks something like this. root ->inc ->files ->system ->->area ->->group ->->->Layer3 etc. I want to add a include file from the original folder level from the "inc" folder. The file of where the include will be used is located within the folder named Layer3 folder. How do I add in the include referencing the file. Do i just use".." For every folder level i want to go up to gain access to the file? Do i just continue to add ".."?
ASP Includes
My web designer created my site with a header include or something to that effect. My question is this: How do I change each page title to what I would like for SEO purposes? When I put the desired title onto each page, my includes/header.asp file "overwrites" the desired title; thus, every static page has the same title. Creating separate include files would work but would take forever. I have even tried leaving the title tag blank in the includes.asp file and add the desired title to each static page, but the title tag doesn't end up in the <head>, just the <body> tag.
Xml Includes
I have a XML file that I've formatted using xsl. now I'd like to include that xml just like a normal file in an asp page. I have the following code but it's really buggy and sometimes it works and sometimes it doesn't, really confusing!!! Code:
Includes
When writing ASP pages that have include pages, is best to make the include pages as txt, asp, inc??? which format would be the most efficient.
Includes
I've a big include asp file with a lot of function and subs, some of them with a long html code embebed, in this intranet and I'm not sure if I should break it in a several include files in order to improve the performance. My question is: leave it as it is because all that code runs into memory only once , say at log in, or break it in several others, in order to access the code that really is to be accessed.
Includes
I have a table that I am using as a main skeleton for all my pages to use. The problems is that I want other pages to be inserted into a specific cell. I have a skeleton.asp with 2 rows and 2 columns. I will create pages like company.asp which will have just text in them and they will use the include tag and include the skeleton.asp. The problem is that I want the text only page to be inserted into the lower right cell on the table in the skeleton.asp. I have seen it done many times but I cannot remember what the tag was that you put in the cell to put the include contents there.
Includes
I have a page that uses includes.It has 1 include to bring in a header, 1 for the menu, and then there is a content area. This content area I need to change.So, for example, the link would be index.asp page=aPage.asp and it would load my page that page witht the header and menu and for the content area include aPage.asp. What is the script I can do this with. I tried simply using Response.Write and then just righting the <! #include --> tag with the right page in there, but it just writes that without parsing it and including that page.
Includes And CSS
I have an include, which is used as the header of my site, that has a bit of CSS coding in it. The CSS code along with an unordered list creates an expandable menu. The include works great when you view it at its URL, but the menu doesn't expand when a person has to access dynamic pages. I have found out that the problem is that when the file is included the code is not inside the <head> tags, so thus the menu doesn't perform, or expand. Is there any snippet of code that could automatically put the CSS inside the <head> tags?
ASP Includes
I am trying to write a little script using includes ... but I am getting errors, I am passing a URL variable to use an include .Code: <!--#INCLUDE VIRTUAL=Request.QueryString("path")--> Am I missing something?
Includes Like ISS
I have made my asp pages but the left side navigation menu I want to be an include so if I ever change a link it's easy to update them all by changing the nav.asp file. How can I include the nav.asp file on the other asp sites like adminpanel.asp .
Includes
Can someone comment on the use of SSIs? Do these place a lot of strain on the server? Also, are "virtual" includes or "file" include directives more efficient?
2 Asp Includes, And One Depends On The Other
I have a main file (asp), from which I include 2 different asp files. The second included asp file references an array element deefined and populated in the first include asp file. However, the array value is not being resolved in the second include. This is not on a Windows server, but rather a UNIX server. However, the host provider claims ASP and SSI support.
How Do Includes Affect?
if there are alot of include file in ASP pages, what happens? the so much include files,the diffucult page load ?
<iframe> And Asp Includes?
saddled with using an <IFRAME> area on a classic asp page from the designer, so I'm trying to find out the following. on that page I usually use the <IFRAME> to hold a simple HTML page, that the client will have access to from my CMS program so they can make edits, updates etc. but, one page has a search functionality, written in classic ASP and using MS-Access dbase to find members of the association etc. when I put the asp search page inside the <IFRAME> src , it wont show? ie -- <iframe src="findlawyer.asp" frameborder="No" width="756" height="427" id="iFrame" vspace="10"> -- should mean that the page findlawyer.asp should show up inside the holding ASP page (called simply find.asp) why? when I look at the findlawyer.asp page online it shows up perfectly and works perfectly too....yet inside the <IFRAME> it refuses to show up???
Dynamic Includes From URL
Is there any way to dynamically generate an include file based on a variable passed to the asp page via a url ?- so for example: Person x clicks on a url - that ur directs them to template.asp (template.asp has no code in it other than page title etc and <!--#include file="<%variable%>" --> ) Once in template.asp the page loads the include file that is relevant to the companies website that the link was clicked from. In that include file will be the correct form and stylesheet setting for that company. What we are trying to do is achieve a global template file which multiple customers can direct peo[ple through and all the data is therefore stored in one central repository. The file displayed when they reach template.asp will depend on the url they clicked. Basically how can i get the url to pass the variable which the include file will then load??
Nesting Includes In Asp
would there be a limit to the amount of nesting one can do with includes in asp? what would be a good rule of thumb?
Conditional Includes
Will this work in asp 3.0: If True Then <!-- #include file="test1.asp" --> Else <!-- #include file="test2.asp" --> End If
Runtime Includes
I need to include an .asp file into another .asp at runtime, but I need to do it based either on data returned from a dB or from the querystring. Since Server Side Includes happen before any script code is processed I can't accomplish this task using SSIs. At least not that I'm aware of. The intent is to get a custom style sheet and/or theme design template based on who the user is or which site their visiting e.g. site1.domain.com has a default template of clouds and site2.domain.com has a default template of water, but both may be set by the user to their template choice.
Dynamic Includes
how can i include aspp files dynamically using <!-- #include file="somefile.asp"-->
Includes And Stylesheet
I have an index page (home.asp) that calls several includes to create the whole page (ie side.asp, top.asp, body.asp). If I externally refer to stylesheets in my homepage, they don't seem to transition into my includes. I can put a <head> on each of my includes and put the internal CSS there. This works, but doesn't seem right, and looks funny in source code seeing multiple <head> tags. recommend a good tutorial for intermediate CSS? I read Yahoo's source code and I don't understand a lot of what they're doing there... I feel like I'm just a few steps behind understanding that.
Dynamic Includes
I am currently working on a template that will be replicated over 200 sites or so. The first of these have been interesting. I'm trying to work out the best ways to replicate these sites and need help with a left sidebar containing links to the first 40 sites. Go to carpetbid.com or spabid.com. I tried doing an include over multiple sites but have read a lot about it and see that this doesn't work.What should I do?
Includes With Variables
I'm trying to create some includes with vars from the query string, but it's not going well. Lets say i get some vars from the url ['lang' and 'page'], sanitise them, and then try to use them in the include. I've tried all sorts . Code: <!--#include file="<%=lang%>/<%=page%>.asp"--> Code: Response.Write("<!-- #include file=""+lang+"/"+page+"" -->") but nowt seems to work.
Includes And Tables
Is there a way to include a large list (.html page) in a table and force a scrollbar instead of resizing the cell to fit the entire list? I'm wondering because I have a navbar on the left that links to different parts of the list (months), and I would like it to stay on the screen, even when scrolling down near the bottom.
Simple Question About Includes
I have a menu I want to include on every page but may update at a later stage so it's easier to use an include. The menu is just a basic html table, no vbscript contained within it. The site is a mixture of static page and ASPs, should I use #include file ="menu.htm" or #include file="menu.asp"? Also if I have a .htm page, can it have an #include file="menu.htm" or must I give that page a .asp extension?
ASP Vbscript Class Includes
I'm running into a problem with VBSCRIPT classes in ASP. I use a seperate file for each class I use. Some of these class files are included in multiple ASP scripts, but are also included in other include files. So if you can't see the problem already, it is that occasionally the class file will be included twice in the same script, relsulting in the following error: Microsoft VBScript compilation error '800a0411' Name redefined /includes/classes/closableobjectlist.asp, line 2 Class ClosableObjectList ------^ Does anyone know a clean solution for this problem?
Javascript Includes Not Recognised
I have web pages that are made up of a number of javascript include files as well as 'in page' script. They all work fine running locally until I hosted them on our IIS server. Then the pages refuse to see nested javascript calls. e.g. Main page contains JS code to call a function to one of the include files (- no probs), which in turn wants to call a function in one of the other JS include files but falls over with 'object expected' error in the line of that call - I assume because it can't fine the function. I think it may be something to do with processing order but as these files are almost identical to another site that I created (certainly the JS include files are and that worked 100%),
Includes And HTML Comments
The use of includes in ASP is good where code is re-used in multiple forms,etc. (doh, ... that's what they _are_ for ! ). If I have something like: Code:
Server-Side Includes
The book I am referring to learn ASP states the following about server- side includes: ============================================== The code in a server-side include file is inserted into the pages that use it BEFORE the page's ASP code is evaluated. This means that you can put ASP code inside the include file, and it will be executed like it was part of the page that includes it. On the other hand, it means that you cannot use ASP to determine which page to include. ============================================== But as opposed to the last line in the above para, the following code makes use of ASP to determine which page to include: Code:
COMs, DLLs, Includes
I have a web page, that is part of a content management system i am writing, it includes a large number of scripts and displays one of these scripts according to the contents of the querystring (the design is done this way so scripts can be used across different websites that i manage on a dedicated server) the problem is that this design is not very scalable and no matter how well i write my code to make it as concise as possible the main page will start getting slower and slower. The answer I initialy thought was some sort of dynamic include but i realise that that is impossible. So what are my options? I have heard of coms and dlls but know very little about them is this the way to go?
Server Side Includes
I am troubleshooting a web site (not written by me) and may of the pages use server side includes. This one page includes a page that return includes the page the included it. Page 1 (_connection.asp): <!--#include file="MGroups/MRdisplayfun.asp"--> Page 2 (MRdisplayfun.asp): <!--include file="../_connection.asp"--> The site is quite slow and when I first found this I thought that this was the primary cause of it. Then I thought this page shouldn't work at all because it would create an infinite loop and should just recursively call the pages and eventually consumme all server resources and database connections. However it doesn't appear to act that way and the page does display and there is no endless calls to the SQL statements in the two pages. Is there something that prevents recursive calling when using SSIs?
Secure Dynamic Includes
Is there a way to make this script more secure? I usually do my coding in php where i can strip slashes and tags to prevent evil code from being included. can something similar be done with asp? <% dim pid pid = Request.QueryString("pid") if pid = "" then fil = "content/page1.asp" else fil = "content/" & pid & ".asp" end if Server.Execute(fil) %>
|