Click to See Complete Forum and Search --> : Please help - I've got a question about ASP scripts and Functions
Xenonic_Rob
Oct 28th, 2000, 06:08 AM
Hi there everyone.
I've had a thought - I want to use an ASP script to produce a string response that can be fed into a client browser and interpreted there. For example:
<script language="vbscript">
Whatever = "http://www.host.com/script.asp?variable=value"
Document.write "The script returned "& Whatever &" as a response."
</script>
Obviously this won't work, but would someone please help me grab a response from an ASP script and put it in a normal HTML file (where it can be played about with and interpreted in different ways). I hope you understand this because I'm not sure I do :)
Well, you are right.... I don't really know what you are looking for.
If it's something like building the querystring to go to a page, and then redirect it to a page, then that goes something like this (in ASP code) :
-----------------------------------------------
dim strWhereTo
strWhereTo = "http://www.host.com?"
if Option1 then strWhereTo = strWhereTo & "option1=value1&"
if Option2 then strWhereTo = strWhereTo & "option2=value2&"
strWhereTo = left(strWhereTo, len(strWhereTo) - 1)
response.redirect strWhereTo
-----------------------------------------------
If that was not what you meant to ask, then please re-formulate the question in a clearer way.
Mark Sreeves
Oct 30th, 2000, 10:33 AM
any help?
<%
response.write "<script language=javascript>" & vbcrlf
response.write "document.write('The script returned <b>' + document.location + '</b> as a response');"
response.write "</script>" & vbcrlf
%>
Xenonic_Rob
Oct 30th, 2000, 12:12 PM
I appreciate what you've tried but it's not really what I'm looking for. Here's another go at explaining it:
In an ASP script, I open a text file on the server, which gives me a number (it's for a hit counter service), let's say "354".
I want some way for this number to be put on a users page, where I can fiddle about with it like
For a = 1 to Len(thenumberofhits)
Document.write "<IMG SRC='"& Mid(thenumberofhits, 1,1) & ".gif'>
next a
That way, individual digits of the hit counter are written to a users page. If this is not possible, could someone tell me how to get an ASP script to return a binary image file so I can link it like
<IMG src="http://www.server.com/script.asp?account=robert">
And it will display the graphical hit counter. I know how to do a text based one (http://www.xenonic.com) but I need to do a graphical one, responding to users requests. Any clearer?
In my opinion what you just wrote yourself should work. At least when you have the right path where the image is stored.
So have you tried your way? And if so, and it failed, what was the error message?
Xenonic_Rob
Oct 31st, 2000, 12:06 PM
Well yes - the code would work. But I still need to get the value for "thenumberofhits".
I want the ASP script to return this "thenumberofhits" to the client browser. This would be fine if the page was an ASP page, but it's a hit counter, so I need to get the value remotely.
Get it?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.