Passing in a variable

H

HPC

I have a page that is used as a photo gallery. I would like to pass in a
position (int) that would set which image to start with. For example, the
page could be found at:

http://www.website.com/gallery/091005.HTM

and on the page 091005.htm I have a variable iStart that by default is 1
which instructs the page to start with the first image. I would like to pass
in another start value, for example 10, which would instruct the page to
start with image #10. All image names and locations are stored within a array
of addresses.

Thanks,
 
H

HPC

Thank you for getting me started. I placed:

<td align="center"> <%= Request.QueryString("startAt") %> </td>

in a table and I can see the value being passed in through the URL. As I
understand, it comes in as a text. I need it in a variable that will control
a position within a array. I have not been able to get this numberic value
extracted,

Suggestions? - Thanks
 
S

Stefan B Rusynko

In your main page create your link to 91005.asp
http://www.website.com/gallery/091005.asp?startAt=XXXX

In 91005.asp at the top in code view add
<%
startAt = Cint(Request.QueryString("startAt"))
%>

Then in your table use
<td align="center"><%=startAt%></td>

But what type of array (client side javascript ) or server side (ASP) are you using
- the above approach will give you a numeric value server side (not in a client side script)
If you are using are using side array see say http://irt.org/script/737.htm
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Thank you for getting me started. I placed:
|
| <td align="center"> <%= Request.QueryString("startAt") %> </td>
|
| in a table and I can see the value being passed in through the URL. As I
| understand, it comes in as a text. I need it in a variable that will control
| a position within a array. I have not been able to get this numberic value
| extracted,
|
| Suggestions? - Thanks
|
| "Pinata Brain" wrote:
|
| > rename your page to http://www.website.com/gallery/091005.asp
| > then in the page 091005.asp
| >
| > add,
| > <%=Start = request.querystring("startAt")%>
| >
| >
| > send the users to http://www.website.com/gallery/091005.asp?startAt=XXXX
| >
| >
| >
| >
| > | > >I have a page that is used as a photo gallery. I would like to pass in a
| > > position (int) that would set which image to start with. For example, the
| > > page could be found at:
| > >
| > > http://www.website.com/gallery/091005.HTM
| > >
| > > and on the page 091005.htm I have a variable iStart that by default is 1
| > > which instructs the page to start with the first image. I would like to
| > > pass
| > > in another start value, for example 10, which would instruct the page to
| > > start with image #10. All image names and locations are stored within a
| > > array
| > > of addresses.
| > >
| > > Thanks,
| >
| >
| >
 
H

HPC

Hello Stefan,

I added the lines:

<%
startAt = Cint(Request.QueryString("startAt"))
%>

and

<td align="center"><%=startAt%></td>

As you have suggested. I use the display in the table cell only to see the
value being extracted with QueryString. I can send in a number through the
URL as

http://www.highpeaksclimbing.com/gallery/091005/091005CSa.asp?startAt=12

Later in the body I set a start value as (Update() function):


if(g_firststart==1)
{
g_firststart=0;
g_fPlayMode=0;
g_iimg=startAt;
}


I get the error that "startAt" is undefined.

Thanks in advance for any help.
 
H

HPC

I found my error!

When I updated the start value as:

g_iimg=startAt;

I was getting the error that 'statAt' was not defined.

Working through it, I used:

g_iimg = <% = Start %>

and all worked well.

Thanks,
 

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

Top