Hi David,
Thank you for your response. From your feedback I went and did another
search online to look for an ASP solution and I changed my code to read :
refer= Request.ServerVariables("HTTP_REFERER")
That was it and it is working perfectly.What a relief. I am branching out
into creating more dynamic pages with Javascript and am making mistakes
along the way. I posted the above code to help anyone else who might be in
the same situation. I see too often someone with a cool problem and then
they simply post "Thanks I found the answer and it works great" or
something like that. LOL It doesn't help the rest of us out. I am using an
older book that I bought real cheap by Coriolis and it didn't have the
HTTP_REFERER as part of the Server Variables Collection. I guess I better
get out and look for a better reference too.
Thanks for the push in the right direction.
Brian
"David Dorward" <do*****@yahoo.com> wrote in message
news:br*******************@news.demon.co.uk...
Brian wrote:
Can someone please point me in the right direction I am having problems
combining JS and ASP. What I am trying to do is store in a database
using ASP the referring page of my visitors. I got the ASP working great and
when I use the document.referrer in an alert it works too, but when I
try to
combine the 2 languages that is when I get an error that I cannot fix.
Here is the code fragment that is not working:
rs("ReferPage") = %> document.referrer <% I am probably missing something very basic but I am at a loss to think
what it could be.
ASP is a means of executing scripts on the server, JavaScript (in this
usage) is a client side language. The ASP runs on the server, the
JavaScript runs on the client. The direction of communication is from the
server to the client, not the other way round. To get data from JavaScript
to the server you have to make a new HTTP request containing the data.
Its a big was of time trying to do that for this though - as the referer
information is already exposed to ASP anyway (although I'll point out that
the referer header is optional so the browser doesn't have to provide it -
and some personal firewalls obscure the referer in the interests of
privacy (why they don't just discard it I don't know, malformed http requests help
nobody)).
--
David Dorward <http://dorward.me.uk/>