Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 space in url
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

VodkaFish
Average Member

USA
654 Posts

Posted - 21 May 2002 :  23:26:18  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
Hey, hoping for ideas.

I'm passing info through urls. Sometimes there's a space (no control over it). So, when it's who.asp?name=VodkaFish - I'm fine.

But when it's who.asp?name=Vodka Fish - I'm not.

It's actually ok in IE, because IE automatically makes it Vodka%20Fish, and Netscape does not. I need this to work in Netscape though. And - I'd prefer if somehow all the spaces were erased, so VodkaFish and Vodka Fish are the same. It's ok if I even pass it on to another page.

Any ideas? (hope I made sense )

v ø d k â f ï § h

Nathan
Help Moderator

USA
7664 Posts

Posted - 21 May 2002 :  23:28:17  Show Profile  Visit Nathan's Homepage
You could use replace to make all the spaces %20 in the link.

Nathan Bales
Snitz Exchange | Do's and Dont's
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 May 2002 :  23:37:54  Show Profile
you can use:

escape("Vodka Fish")


That will convert the space to %20
Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 22 May 2002 :  01:01:21  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
quote:
you can use:

escape("Vodka Fish")


That will convert the space to %20
Unfortunately, this didn't work.

I still get this in Netscape:
HTTP Error 400

400 Bad Request

Due to malformed syntax, the request could not be understood by the server. The client should not repeat the request without modifications.


I'm confused, because I've seen someone esle do it (uses spaces in a url in Netscape).

I'm using it like this btw:
name = Request.QueryString("name")

name = escape(name)


v ø d k â f ï § h
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  01:03:13  Show Profile
you can also try:

Server.URLEncode(name)
Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 22 May 2002 :  01:30:06  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
quote:
you can also try:

Server.URLEncode(name)
Yeah, tried that too. This is very weird, it should work.

The one person I remember seeing do it linked to a php page, but I would wind up on an asp page (not that I don't know how that happened, but I thought that was interesting). I know that probably doesn't help, but I thought I'd throw that in anyway.

Thanx for your help so far

v ø d k â f ï § h
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 22 May 2002 :  02:16:10  Show Profile  Visit Gremlin's Homepage
you want to use the escape when your building the querystring rather than after. Remember 40x errors are client side so its something browser related, 50x are Serverside.

I'm assuming your creating some links on a page which when clicked take you to a detailed page for a user and your passing the user name through via the querystring ?

If so then when your building the first page with the links on it, that is when you need to escape the name

So you would have something like this


<a href="/who.asp?name=<%=escape(name)%>">Click to View <%=name%>'s Profile</a>


Then by the time you get to the who.asp page the string is correctly escaped.



www.daoc-halo.com
Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 22 May 2002 :  02:40:02  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
quote:
So you would have something like this


<a href="/who.asp?name=<%=escape(name)%>">Click to View <%=name%>'s Profile</a>


Then by the time you get to the who.asp page the string is correctly escaped.
Understand what you're saying, but unfortunately, the link is on a strictly HTML page, and cannot read ASP. That's been the hardest part of this.

v ø d k â f ï § h
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 22 May 2002 :  03:10:31  Show Profile  Visit Gremlin's Homepage
But whats generating the HTML Page ?

www.daoc-halo.com
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  03:48:20  Show Profile
so this page is a static page and the link is manually put on the page?

If so, try either this:

who.asp?name=Vodka%20Fish%20-%20I%27m%20not.


or this:

who.asp?name=Vodka+Fish+%2D+I%27m+not%2E
Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 22 May 2002 :  09:12:57  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
quote:
It's actually ok in IE, because IE automatically makes it Vodka%20Fish, and Netscape does not. I need this to work in Netscape though.



Interestingly, using FrontPage, we haven't had this problem, but other departments within our company who don't use FrontPage have. Evidentally FrontPage includes the code somewhere to convert this. Someone is more than welcome to sort through all of the code FrontPage generates to find this if they want. ;-)




Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 22 May 2002 :  09:55:13  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
quote:
But whats generating the HTML Page?
An outside source. The only thing I'm able to do is setup a link in strict html. Being something like "who.asp?name=".

Think of it like this: I'm running AOL Instant Messenger. If someone clicks on "info" about me, I can fill that in with whatever I want - as long as it's html. I can however, include 1 of 3 variables. One includes %n - being that persons screen name. Now, the link I have created takes their screen name like "who.asp?name=screen name". My problem is I can take a name that's 1 word, but a space crashes me down since the little window they create is Netscape based and I haven't figured out a way around this. I have seen people do it though, so it's irritating. Hope I make more sense now

v ø d k â f ï § h
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 22 May 2002 :  18:58:58  Show Profile  Visit Gremlin's Homepage
Yes that does make more sense now, have you got any links to others who've done this ? maybe looking at them we can collectively work out just how they've done it :)

www.daoc-halo.com
Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 23 May 2002 :  01:08:28  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
Sure, www.imchaos.com

His simple list is something very similar to what I've done. My only bug is the space thing so far.

v ø d k â f ï § h
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 23 May 2002 :  02:36:22  Show Profile  Visit Gremlin's Homepage
Interesting, when you use his "Code Generator" and enter say Vodka Fish .. it removes the space again, thats how he got around it I think lol

www.daoc-halo.com
Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 23 May 2002 :  10:32:20  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
quote:
Interesting, when you use his "Code Generator" and enter say Vodka Fish .. it removes the space again, thats how he got around it I think lol
It's not even that, if you then take that code and replace the %n with a name, it removes the spaces in that too. Even if you type it in in Netscape. This is where I got stuck. My code works great until someone with a space in their screen name clicks it No blanks, or someone typing %n in, but spaces just kill it

My brother uses that code and sees who clicks on his info. One was some girl he hadn't gone out with for 4 years. Interesting to see sometimes

v ø d k â f ï § h

Edited by - VodkaFish on 23 May 2002 10:43:55
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07