Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Problem with variable inside a for cycle

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,57809
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Problem with variable inside a for cycle
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Problem with variable inside a for cycle - 3/11/2008 10:27:07 PM   
  Maika

 

Posts: 1
Score: 0
Joined: 3/11/2008
Status: offline
Hi.

I´m new in the forum and i start with a problem i´m having in my code and hope you can help me out.

The code is related with a search for products in my database.

The problem is that in the for cycle that i have to make the pages ( if there are more then 30 products ) my variable to send through the querystring link is not complete.
If i make the search with just one word it goes ok, but if i place 2 words separated by space it only shows the first word.
The for cycle is only to make the page links, it doesn´t affect the variable at all.
Here is some code:

' this code receives the variable that comes from the text form ) 
Dim exemplo
example=strText2

At this stage if a print example it shows the right value. ( either if it´s one word ore more, no problem until here )


' this code is to make all the necessary pages in a link to go to the next page

pages = "&nbsp;&nbsp;"
For l = 1 to ipage
 If l = page then
 
  pages = pages &  "&nbsp; [" & page & "]  &nbsp;"
 
 Else
     
     response.write "Go 24"
     response.write "<br><br>"
     response.write example
     response.write "<br><br>"
     
   pages = pages & " <a class='pagpesquisa' href=searchaction.asp?pesquisa="&example&"&intPrice="&intPrice&"&chkPrice="&chkPrice&"&strCat="&strCat&"&chkCat="&chkCat&"&page=" &l&">" & l &  "</a>" & " &nbsp;"

 End If
Next


When a run this code i get a pass on the G0 24 and i print the EXAMPLE and it show right ( team magic ) - team magic is the variable value.
Here is the print:

Go 24 ( this e a response.write to mke sure that i was going in the right way )

team magic ( this is the response.write of the search variable )

But when i move the mouse pointer into the second page in the browser it only shows (team)
Here is the link that it shows:
searchaction.asp?pesquisa=team

Also it is ignoring the other variables, but i think it is ignoring the other variables because of the first one ( example ).

If i make a search of only one word the result is the following as a link: (bateria is the search word)
searchaction.asp?pesquisa=bateria&intPrice=&chkPrice=&strCat=&chkCat=&page=2

We can see the other varaibles empty but that is not a problem to my code.

Any thoughts ?
If you need to test the code i can supply the link of my store. ( you can check it in english )

Thanks.

Alex








 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Problem with variable inside a for cycle Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts