Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

breaking up a string of text

Status
Not open for further replies.

ZantisWorks

IS-IT--Management
Sep 29, 2009
1
US
I have had in the past few months, wanted some code to break up strings of text. This time around the text happens to be the Request.ServerVariables("HTTP_REFERER"). My friend wrote some code last night and can't get a hold of him tonight so I thought I'd ask this question as I'm not understanding and not a full blown programmer. He used the querystring in his example and for whatever reason I can't seem to figure out how to test his code. The server variable gets saved into a database and then I want to create a code that pulls that string back from the database on a different asp page that breaks up what was saved in the database. So obviously I wouldn't be using the ServerVariable directly. The data gets pulled into VmemReferer variable. Which when I changed the Request.Querystring to that variable it throws errors. I know I know, this is an easy one but still I'm a basic programmer and don't understand why. So here is the code that my friend wrote.


<html>
<body>

<%
dim value
dim valueTable
dim i
dim thePos
'response.Write(Request.QueryString)


For Each item In Request.QueryString
myvalue = Request.QueryString(item)
Response.Write(item & " = " & myvalue & "<br>")
thepos = cstr(instr(myvalue,"+"))
Response.write(thePos + "<br>")
if instr(myvalue," ") > 0 then
Response.write("got here <br>")
valueTable = split(myvalue," ")
' Response.Write(len(Valuetable))
for each myitem in valuetable
Response.Write(item & " = " & myItem & "<br>")
next
end if

Next
%>

</body>
</html>


Thanks in advance for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top