P
PM
I'm trying to make a kind of search history containing the 3 last
searched words. So I'm using 3 Session Variables: Word1 / Word2 /
Word3.
In order to get this history working, I need to put the last searched
word in the following Variable.
Ex.:
Session("Word3") = Session("Word2")
Session("Word2") = Session("Word1")
Session("Word1") = Request.QueryString("WORDS")
That way, Word1 is equal to the last searched word, Word2 is equal to
the last value contained in Word1 and Word3 is equal to the last value
contained in Word2.
So, if I search those words in order: carot, orange, apple, rabbit; it
should end up like this:
Word1 = "carot"
Word2 = ""
Word3 = ""
=========
Word1 = "orange"
Word2 = "carot"
Word3 = ""
=========
Word1 = "apple"
Word2 = "orange"
Word3 = "carot"
=========
Word1 = "rabbit"
Word2 = "apple"
Word3 = "orange"
=========
**************************
But instead of this I get:
Word1 = "carot"
Word2 = ""
Word3 = ""
=========
Word1 = "orange"
Word2 = "carot"
Word3 = "carot"
=========
Word1 = "apple"
Word2 = "orange"
Word3 = "orange"
=========
Word1 = "rabbit"
Word2 = "apple"
Word3 = "apple"
=========
I can't explain what is happening!?
Please, can somebody help me!
Thanks a lot!
** and sorry if my english isn't very good ...
searched words. So I'm using 3 Session Variables: Word1 / Word2 /
Word3.
In order to get this history working, I need to put the last searched
word in the following Variable.
Ex.:
Session("Word3") = Session("Word2")
Session("Word2") = Session("Word1")
Session("Word1") = Request.QueryString("WORDS")
That way, Word1 is equal to the last searched word, Word2 is equal to
the last value contained in Word1 and Word3 is equal to the last value
contained in Word2.
So, if I search those words in order: carot, orange, apple, rabbit; it
should end up like this:
Word1 = "carot"
Word2 = ""
Word3 = ""
=========
Word1 = "orange"
Word2 = "carot"
Word3 = ""
=========
Word1 = "apple"
Word2 = "orange"
Word3 = "carot"
=========
Word1 = "rabbit"
Word2 = "apple"
Word3 = "orange"
=========
**************************
But instead of this I get:
Word1 = "carot"
Word2 = ""
Word3 = ""
=========
Word1 = "orange"
Word2 = "carot"
Word3 = "carot"
=========
Word1 = "apple"
Word2 = "orange"
Word3 = "orange"
=========
Word1 = "rabbit"
Word2 = "apple"
Word3 = "apple"
=========
I can't explain what is happening!?
Please, can somebody help me!
Thanks a lot!
** and sorry if my english isn't very good ...