ASP Include Help

windows

Guest
Hey, I've just dived into ASP today for this new site I'm building. I'm experienced with PHP but I thought I'd try ASP out for this one. Can anyone help me with this script. Its basicly just changing the contents of the body of the page by the links changing the variable.

<% if p="" then %>
<!--#include file="home.asp"-->
<% elseif p=members then %>
<!--#include file="members.asp"-->
<% elseif p=tourneys then %>
<!--#include file="tourneys.asp"-->
<% elseif p=links then %>
<!--#include file="links.asp"-->
<% end if %>

The links change the link from index.asp to index.asp?p=members etc...

Thanks.

-ShivAdd quotation marks around strings, i.e. if p = "members"where is the variable "p" defined?I'm guessing p is given the value of the QueryString p... if not, then they should add:

p = Request.QueryString("p")i would assume also, in both cases you are correct.<%
p=request("p")

if p="" then %>
<!--#include file="home.asp"-->
<% elseif p="members" then %>
<!--#include file="members.asp"-->
<% elseif p="tourneys" then %>
<!--#include file="tourneys.asp"-->
<% elseif p="links" then %>
<!--#include file="links.asp"-->
<%
else
response.write "Nothing"
end if %>I would place the "" option has the default instead of nothing.

That should be correct.

Also you need to use the specific collection to get the data, otherwise you are searching every one until you find the first instance.
 
Back
Top