473,410 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Special Characters in passed Query String

Hello all. I am a very new ASP programmer and am having problems with a
special character in a query string. The first pages pulls up a record and
when the id number is click, you go to the details page. The records rowid
is passed to the second page and then the database is requeried for the
detail results. We came across this problem when a rowid in
Oracle(hexadecimal) had a + in it.

This is what is passed:
http://servername/details.asp?privro...0000.0000.0000

but

subnum = Request.QueryString("privrow") = AAAKN/ADjAAAM8CAA not
AAAKN/ADjAAAM8CAA+

At this point I get rowid invalid.

Here is the code that creates the string:
response.write("<A href=""details.asp?privrow=" &
replace(trim(Recordset1.Fields.Item("rowid1").Valu e) + "&vessrow=" +
trim(Recordset1.Fields.Item("rowid2").Value),"%20" ,"") & """>") %>

<%=(Recordset1.Fields.Item("lic_num").Value)%></A>
And the code that reads it:
subnum = Request.QueryString("privrow")

I must add a side note, this is a site I have little experience with. I've
inherited it with these problems and must just apply a fix and not a
rewrite. I know there is probably a better way to handle this but it's not
feasable at this time.

Thanks for your time,
Sunshine

Jul 19 '05 #1
2 17309
Use server.urlencode() before appending the value to the querystring.


"Sunshine Valdes" <su*************@fwc.state.fl.us> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Hello all. I am a very new ASP programmer and am having problems with a
special character in a query string. The first pages pulls up a record and when the id number is click, you go to the details page. The records rowid is passed to the second page and then the database is requeried for the
detail results. We came across this problem when a rowid in
Oracle(hexadecimal) had a + in it.

This is what is passed:
http://servername/details.asp?privro...0000.0000.0000
but

subnum = Request.QueryString("privrow") = AAAKN/ADjAAAM8CAA not
AAAKN/ADjAAAM8CAA+

At this point I get rowid invalid.

Here is the code that creates the string:
response.write("<A href=""details.asp?privrow=" &
replace(trim(Recordset1.Fields.Item("rowid1").Valu e) + "&vessrow=" +
trim(Recordset1.Fields.Item("rowid2").Value),"%20" ,"") & """>") %>

<%=(Recordset1.Fields.Item("lic_num").Value)%></A>
And the code that reads it:
subnum = Request.QueryString("privrow")

I must add a side note, this is a site I have little experience with. I've inherited it with these problems and must just apply a fix and not a
rewrite. I know there is probably a better way to handle this but it's not feasable at this time.

Thanks for your time,
Sunshine

Jul 19 '05 #2
Gazing into my crystal ball I observed "Sunshine Valdes"
<su*************@fwc.state.fl.us> writing in
news:eJ**************@TK2MSFTNGP09.phx.gbl:
Hello all. I am a very new ASP programmer and am having problems with
a special character in a query string. The first pages pulls up a
record and when the id number is click, you go to the details page.
The records rowid is passed to the second page and then the database is
requeried for the detail results. We came across this problem when a
rowid in Oracle(hexadecimal) had a + in it.

This is what is passed:
http://servername/details.asp?privro...essrow=0000000
0.0000.0000

but

subnum = Request.QueryString("privrow") = AAAKN/ADjAAAM8CAA not
AAAKN/ADjAAAM8CAA+

At this point I get rowid invalid.

Here is the code that creates the string:
response.write("<A href=""details.asp?privrow=" &
replace(trim(Recordset1.Fields.Item("rowid1").Valu e) + "&vessrow=" +
trim(Recordset1.Fields.Item("rowid2").Value),"%20" ,"") & """>") %>

<%=(Recordset1.Fields.Item("lic_num").Value)%></A>
And the code that reads it:
subnum = Request.QueryString("privrow")

I must add a side note, this is a site I have little experience with.
I've inherited it with these problems and must just apply a fix and not
a rewrite. I know there is probably a better way to handle this but
it's not feasable at this time.

Thanks for your time,
Sunshine


<%response.write("<A href=""details.asp?privrow=" & replace(trim
(Recordset1.Fields.Item("rowid1").Value) & "&vessrow=" & trim
(Recordset1.Fields.Item("rowid2").Value),"%20","") & """>") %><%=
(Recordset1.Fields.Item("lic_num").Value)%></A>
Replace the + with & . IIRC + is for javascript.
--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael Hill | last post by:
How do I detect the special characters " ' or & when the user pushed them. I have this code: <input type='text' onKeyUp='ck_char(this,event);'> function ck_char(fld, e) { var key = ''; var...
4
by: Ewok | last post by:
let me just say. it's not by choice but im dealing with a .net web app (top down approach with VB and a MySQL database) sigh..... Anyhow, I've just about got all the kinks worked out but I am...
3
by: SMG - Idealake | last post by:
Hi All, I have created an application which is working fine and is in about to launch, now suddenly my mgmt says there are chances that Scrip ID( a particular id and not prim key) may have special...
3
by: george.lengel | last post by:
Hello experts, I have been struggling for days to solve this problem and every suggestion I find via Google does not work for me. There is probably a solution out there that will do what I want,...
8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
1
by: rogoflap | last post by:
I have some regular text I export to a word document. I build this in VBA in Access and want dump it into word. I can do this, but would like to know how I can turn on an off bolding or...
13
by: titan nyquist | last post by:
How do you test a string to see if it contains special characters? I want to ensure that any names typed into my form has only letters (and maybe allow a dash and an apostrophe). I can loop...
6
by: TheRealDan | last post by:
Hi all. I'm having a problem with a special characters. I have php script that reads from an xml file and writes to a mysql db. It's a script called phptunest that I found on the net, although the...
5
by: Sobin Thomas | last post by:
Hi All, I want to pass a string that contains many special characters (: \ . _ etc) to another page in my website through query string. In my project I have a Gridview control ,in which there...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.