473,323 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

SSI Include dynamic URL

Hi,

I'm trying to use SSI include (platform Win XPsp2 IIS5.1)

I can do this <!--#include file="somefile.inc"-->

To get 'somefile' into my page.

What I am trying to resolve is there anyway to define the url dynamically eg

somefile_1.inc
somefile_2.inc
somefile_3.inc

I dont know enough to know whether this even achieveable.

Thanks
H
Jul 20 '07 #1
1 1990
You can do this by using a server side scripting language like ASP, ASP.net or PHP.

In ASP for instance: let's say you call the asp-file with a querystring like this:
http://www.site name.com/yourpage.asp?par=2

Put this asp code in test.asp before the <DOCTYPE ..>-declaration or else if the declaration is absent before the <head> tag of your html:

<%
Dim par
par = 0
If request.Querystring("par") <> "" Then par = request.Querystring("par") End If
%>

And then, wherever you need it:

<!--#include file="somefile_<%= par %>.inc"-->

should do it, in this case the result will be:

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

If the asp file is called without a querystring like
http://www.site name.com/yourpage.asp
then the result will be:

<!-- #include file="somefile_0.inc" -->
Jul 20 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: mdawg414 | last post by:
Hey guys, please bear with me cause I am a major newbie at php. I am building a website and have it so that the content in the middle of the page changes but the banner on top and the panels on the...
21
by: .:mmac:. | last post by:
I have to update a page every week. I get the page ahead of time so I used the "scheduled includes" webbot in Frontpage only to find that I would have to refresh the page every week to have it...
3
by: Buddy Robbins | last post by:
Hey folks, I am re-writing an ASP.Net site for a company. The client wants to be responsible for the static content and navigation of their site, and I'll be responsible for any dynamic content. ...
9
by: Sarath | last post by:
I am working with an application using ASP, getting below error when i am trying to include new asp include file. _____________________________________________________________________ Microsoft...
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
14
by: Pedro Graca | last post by:
Imagine I have a structure with a size_t member: /* foo.h */ struct foo { char const *bar; size_t barlen; }; void make_foo(struct foo *p);
3
by: Larry | last post by:
Hi, I need a method to dynamically include a server side include in my asp.net page. The problem is, the include file contains asp.net controls, and I can't find a way to get the controls to...
2
by: newsgroups | last post by:
What I'm trying to do is for each page I want to have a dynamic include that is derived from the current document name. Example, for a page named foo.shtml I want to derive the following...
11
by: McKirahan | last post by:
I am looking for feedback on an approach to using PHP. Below is a stripped down version of a Home page: "index.php". The content of the site is displayed in the middle of the page and is...
4
by: clinisbut | last post by:
may be i'm asking a stupid question, but, is it possible to include a header file at runtime?? I have some header files with this inside: {{12, 16},{ 0x00,0x00, /* ................ */...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.