Query string testing

C

Carl Gilbert

Hi



I am working on a site to provide displaying and navigation of images from
several groups and have the following code that changes to displayed gif
based on the query string passed in:


Call: <a href="ShowImage.asp?group=01&image=01&max=28">Group 01, Image 04,
Max 28</a>



<%

grp = request.QueryString("group")
img = request.QueryString("image")

max = request.QueryString("max")
%>



<html>
<head>
<title>ShowImage</title>
</head>
<body MS_POSITIONING="GridLayout">



<form id="Form1" method="post" runat="server">
<img src="images/<%=grp%><%=img%>.bmp">

</form>



</body>
</html>



My plan is to load the page with an image from a collection and allow the
user to navigate between the images in the collection using Next and
Previous buttons.



Is there anyway to do something like the following?



if not [image] = 01 then
'show the previous button
elseif not [image] = [max] then
'show the next button
end if



Also, is it possible to add or subtract 1 for the next and the previous
links based on the image value?

{NEXT LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=[image]+1&max=[max]
{PREVIOUS LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=[image]-1&max=[max]



Regards, Carl Gilbert
 
M

Maarten

How do you want to start? Can the user choose the group and the first
record? Or only the group? And how do you calculate the max parameter. Or
the pictures by group in one folder or all the pictures of all the groups in
one folder? How are the pictures named ?

Maarten.
 
S

Steven Burn

C

Carl Gilbert

This looks good cheers. Unfortunately I got back the following error:

"Variable uses an Automation type not supported in VBScript: 'CLng'"




Steven Burn said:
{NEXT LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=<%CLng(request.querystrin
g("image") +1)%>
{PREVIOUS LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=<%CLng(request.querystrin
g("image") -1)%>

Obviously, the above assumes the image is held in the "image" querystring.
You'd additionally need to replace [group] with
<%request.querystring("group")%> (assuming your querystring is called
"group")

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


Carl Gilbert said:
Hi



I am working on a site to provide displaying and navigation of images
from
several groups and have the following code that changes to displayed gif
based on the query string passed in:


Call: <a href="ShowImage.asp?group=01&image=01&max=28">Group 01, Image
04,
Max 28</a>



<%

grp = request.QueryString("group")
img = request.QueryString("image")

max = request.QueryString("max")
%>



<html>
<head>
<title>ShowImage</title>
</head>
<body MS_POSITIONING="GridLayout">



<form id="Form1" method="post" runat="server">
<img src="images/<%=grp%><%=img%>.bmp">

</form>



</body>
</html>



My plan is to load the page with an image from a collection and allow the
user to navigate between the images in the collection using Next and
Previous buttons.



Is there anyway to do something like the following?



if not [image] = 01 then
'show the previous button
elseif not [image] = [max] then
'show the next button
end if



Also, is it possible to add or subtract 1 for the next and the previous
links based on the image value?

{NEXT LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=[image]+1&max=[max]
{PREVIOUS LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=[image]-1&max=[max]



Regards, Carl Gilbert
 
C

Carl Gilbert

The images are named as follows:

[group]
[images]

01
01, 02, 03, 04, .... 28
02
01, 02, 03, 04, .... 18

I am providing a thumbnail view of all the images so I know the image and
the group selected. I will also know the max number of images in the group.

So I would then pass in the selected group image along with the number
ofimages in that group. From the image and group I am going:

<img src="images/<%=grp%><&=img%>.bmp">

Which would return something like 'images/0205.bmp' where the images are
numbered [group][image].bmp
eg
0101.bmp
0102.bmp
etc

Regards, Carl
 
C

Carl Gilbert

So now thaks to Steven Burn I now have to code to build the links to move to
the next or the previous image in a collection.

My second question now is, how can I dynamically show these links based on a
simple rule?

if not <%=img%> = 1 then
<a
href="ShowImage.aspx?group=<%=grp%>&image=<%=CLng(request.QueryString("image")-1)%>">PREVIOUS</a>
elseif not <%=img%> = <%=max%> then
<a
href="ShowImage.aspx?group=<%=grp%>&image=<%=CLng(request.QueryString("image")
+1)%>">NEXT</a>
end if

Obviously the above code is more VB than anything else, but is something
like this possibly is ASP?

Regards, Carl
 
S

Steven Burn

<%
if Clng(img) > 1 then
%>
<a
href="ShowImage.aspx?group=<%=grp%>&image=<%=CLng(request.QueryString("image
")-1)%>">PREVIOUS</a>
<%
end if
if not Clng(img) = Clng(max) then
%>
<a
href="ShowImage.aspx?group=<%=grp%>&image=<%=CLng(request.QueryString("image
")
+1)%>">NEXT</a>
<%
end if
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


Carl Gilbert said:
So now thaks to Steven Burn I now have to code to build the links to move to
the next or the previous image in a collection.

My second question now is, how can I dynamically show these links based on a
simple rule?

if not <%=img%> = 1 then
<a
href="ShowImage.aspx?group= said:
elseif not <%=img%> = <%=max%> then
<a
href="ShowImage.aspx?group= said:
+1)%>">NEXT</a>
end if

Obviously the above code is more VB than anything else, but is something
like this possibly is ASP?

Regards, Carl



Carl Gilbert said:
Hi



I am working on a site to provide displaying and navigation of images from
several groups and have the following code that changes to displayed gif
based on the query string passed in:


Call: <a href="ShowImage.asp?group=01&image=01&max=28">Group 01, Image 04,
Max 28</a>



<%

grp = request.QueryString("group")
img = request.QueryString("image")

max = request.QueryString("max")
%>



<html>
<head>
<title>ShowImage</title>
</head>
<body MS_POSITIONING="GridLayout">



<form id="Form1" method="post" runat="server">
<img src="images/<%=grp%><%=img%>.bmp">

</form>



</body>
</html>



My plan is to load the page with an image from a collection and allow the
user to navigate between the images in the collection using Next and
Previous buttons.



Is there anyway to do something like the following?



if not [image] = 01 then
'show the previous button
elseif not [image] = [max] then
'show the next button
end if



Also, is it possible to add or subtract 1 for the next and the previous
links based on the image value?

{NEXT LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=[image]+1&max=[max]
{PREVIOUS LINK}
http://whatever/ShowImage.aspx?group=[group]&imgId=[image]-1&max=[max]



Regards, Carl Gilbert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,162
Messages
2,570,896
Members
47,434
Latest member
TobiasLoan

Latest Threads

Top