473,386 Members | 1,791 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,386 software developers and data experts.

Strings for Strings Query

g
hi,

I intend to make a page that will display each categories under a main
category. This is done with XML. A piece of XML code as below.
<xml>
<Category name="Category1">
<Category name="Sub Category1"></Category>
<Category name="Sub Category2"></Category>
</Category>
<Category name="Category2"></Category>
<xml>
I manage to create a page that lay out all the main categories and
hyperlink them.

The problem is this , my hyperlink look like this : <a href
=category.asp?Category=Sub Category1 >

I need to make it look like this <a href
=category.asp?Category=Sub%20Category1 >

Other then SPACE have to be %20, ampersand have to be%26 so on and forth

Is there anyway to encode this: <a href =category.asp?Category=Sub
Category1 > to <a href =category.asp?Category=Sub%20Category1 >???
thank you for any help is given.

Jul 19 '05 #1
2 1835
Replace the spaces with the Replace function?

SomeString = Replace(SomeString, " ", "_")

--
Regards

Steven Burn
Ur I.T. Mate Group CEO
www.it-mate.co.uk

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
g <ma********@netscape.net> wrote in message
news:bo**********@mawar.singnet.com.sg...
hi,

I intend to make a page that will display each categories under a main
category. This is done with XML. A piece of XML code as below.
<xml>
<Category name="Category1">
<Category name="Sub Category1"></Category>
<Category name="Sub Category2"></Category>
</Category>
<Category name="Category2"></Category>
<xml>
I manage to create a page that lay out all the main categories and
hyperlink them.

The problem is this , my hyperlink look like this : <a href
=category.asp?Category=Sub Category1 >

I need to make it look like this <a href
=category.asp?Category=Sub%20Category1 >

Other then SPACE have to be %20, ampersand have to be%26 so on and forth

Is there anyway to encode this: <a href =category.asp?Category=Sub
Category1 > to <a href =category.asp?Category=Sub%20Category1 >???
thank you for any help is given.

Jul 19 '05 #2
Your hyperlink should be:

response.write "<a href='category.asp?Category=" & server.URLEncode("Sub
Category 1") & "'>"

Also, rather than passing big bulky strings around in querystrings, consider
using a smaller primary key (like an integer)... you avoid the above
problem, you reduce overall network bandwidth, you make it less tempting for
people to guess categories by just typing whatever they want into the URL,
and you make it less imposing on users (who may have bookmarked a URL) when
you change "Sub Category 1" to "Sub Category 5"...


"g" <ma********@netscape.net> wrote in message
news:bo**********@mawar.singnet.com.sg...
hi,

I intend to make a page that will display each categories under a main
category. This is done with XML. A piece of XML code as below.
<xml>
<Category name="Category1">
<Category name="Sub Category1"></Category>
<Category name="Sub Category2"></Category>
</Category>
<Category name="Category2"></Category>
<xml>
I manage to create a page that lay out all the main categories and
hyperlink them.

The problem is this , my hyperlink look like this : <a href
=category.asp?Category=Sub Category1 >

I need to make it look like this <a href
=category.asp?Category=Sub%20Category1 >

Other then SPACE have to be %20, ampersand have to be%26 so on and forth

Is there anyway to encode this: <a href =category.asp?Category=Sub
Category1 > to <a href =category.asp?Category=Sub%20Category1 >???
thank you for any help is given.

Jul 19 '05 #3

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

Similar topics

1
by: theboss3 | last post by:
I am having trouble with accessing files with query strings. For example the code "require 'template.php?102932'" gives the following error: Warning: main(/www/blog/template.php?102932):...
4
by: Alistair | last post by:
I should just get a hat with a big D on it and then everyone would recognise me.. anyway... I have a DB full of people and their details.. I'm trying to perform a query based on age. so...
0
by: shank | last post by:
I have a search page and I want to log the query strings being submitted to that page. Variables are being submitted to a stored procedure. In that SP, before the SELECT statement, I placed an...
9
by: Dr. StrangeLove | last post by:
Greetings, Let say we want to split column 'list' in table lists into separate rows using the comma as the delimiter. Table lists id list 1 aa,bbb,c 2 e,f,gggg,hh 3 ii,kk 4 m
0
by: LesM | last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002 SP3. I have Progress table that is linked via ODBC into Access using OpenLink Lite for Progress 9.0b. For over a year, using...
1
by: MattB | last post by:
I'm tightening security on my application by encrypting query strings so someone can't try and guess other valid query string values. This was working well, but I noticed it wasn't working in some...
6
by: Christian Blackburn | last post by:
Hi Gang, When encoding HTML strings it'll convert things like " --> &rsquo and the like using Server.HTMLEncode(). However, is there a command to make sure strings don't contain valid SQL...
3
by: mathewda | last post by:
I'm currently work'n on a project where I'm dynamically generating some HTML as text into a string builder. My ASP page has a <span> tag on it and after I gernerate HTML to my string builder I...
8
by: Allan Ebdrup | last post by:
What would be the fastest way to search 18,000 strings of an average size of 10Kb, I can have all the strings in memory, should I simply do a instr on all of the strings? Or is there a faster way?...
3
by: Nathan Guill | last post by:
I have an interface that works with an Access back-end. I would like to store and/or load user defined query strings per each user (i.e. no user can access another's queries). The idea I had was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.