Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - include file question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

include file question

 Post Reply Post Reply
Author
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Topic: include file question
    Posted: 29 May 2003 at 11:29am

hello

id like to be able to include a file so i can use one page for my site

ie "default.asp?page=home"

and then i want to include the file that stores the "home" content in

but i oviously cant use <!--#include file="<%=page%>"-->

but when i tried the "server.request( page )" it didnt process the ASP in it

is there a way i can do this without having to do

if page = "home" then

    <!--#include file="home.inc"-->

end if

if page = "about" then

    <!--#include file="about.inc"-->

end if

?????

 

(PS i dont think "server.request()" is right, becose i cant remember wot it is, but i did use the right code, becose i copied it straight from a post MadDog made )

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2003 at 12:15pm
It is not possible. If you do a search on this forum you will get tons of posts talking about that. In a Nutshell, Includes are SSI not ASP so get processed before any ASP code. There are no real dynamic includes on asp, you can use server.execute or server.transfer but that is about it.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2003 at 9:52am

yeah i think it was "Server.Execute" wot i acctually used...

that cant process the ASP in the include though can it?

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2003 at 10:40am
Not sure what you mean but server.execute can process any asp as all it does is executing a page being called from the originator.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2003 at 10:47am

well say i have a page called

"usercheck.asp"

and its like

-----------------------

<%

if userlevel = "1 then
   sumfin = "this"
else
   sumfin = "that"
end if

%>

-----------------------

then i have another that does

<% server.execute("usercheck.asp") %>

will it process the ASP from the "usercheck.asp"

cose am sure i got errors when i did it?

BTW, i'll need to use the FileSystem Object, and access databases with the included files

i need the "asp" include and not SSI becose i wanna be able to choose wot to include like

<%
     page = "default.asp"

     Server.Execute( page )
%>

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2003 at 10:58am

just do the if..then...else statements with the includes...

i mean you have already wasted a few days trying to do "sumfin" you don't understand....

just use what works

Contribute to the working anarchy we fondly call the Internet
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2003 at 11:00am

yeah but am tryna find an easyer way of doing wot am tryna do

am currenly usin the

"case" thing

but am thinkin this will be easyer to have, if i wanna add pages

(PS leave my "slang" alone, i listen to rap!)

*edit*

ooh, btw, do you have to have that kinda attitude?

you've had ago at me b4, for ma slang.... mate, this is the internet, slang is all ova the place

and as for me "wasting" 3 days.....
like i said, am only tryna find a better way of doing this!

so how have i wasted 3 days?

if anyfin i wasted time, readin your post!

and i know this is a "ASP Discussion" but if ya read the posts, its mostly people askin for help with there ASP Scripts, and people "helping" others wit there problems, so wanna try an help next time? cose i dont think ya post was much help

and back ta tha slang... wots wrong with me usin slang, do you tell people with poor english to talk better?

just cose you know alot of ASP dont mean we all do, sum of us are tryna learn, like you did one day, so give us a break

(PS yeah i know ya aint allowed to "Flame" but come on! do i gotta take this?)



Edited by Scotty_32
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2003 at 1:10pm

Server.Execute will execute the ASP code on usercheck.asp but it won't be able to interact with the code on the page you're calling it from...

you can include the same asp file in the same page using server.execute as many times as you want with the same variables and it won't interfere with each other...

so server.execute won't do what you're trying to do cuz you can't use the variables from the included file in the file where you called it from  ...basicaly with server.execute it'll look like the included file is on the same page but really is running on a different background as if it where on another window......

FeRnAN
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.