Solved

more help with spaces, please (the '%20's are breeding!)

Posted on 2002-06-13
6
163 Views
Last Modified: 2010-03-05
Okay so this works:

$location =~ s/ /%20/g;

if I take it out, it doesn't work (in Netscape, but IE is fine).

However, it is replacing a single space with THREE '%20's

So that what should be "new york" comes out as "new%20%20%20york" on one page....

But wait there's more (no pun intended)!
On the next page there are 9 of them! they are multiplying by three!

New%20%20%20%20%20%20%20%20%20York

The script works nonetheless, but this is really messy.

Anyone know why it's doing this, and how I can fix it?

Thank you.

0
Comment
Question by:celere
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 3

Accepted Solution

by:
Tsvetomir earned 50 total points
ID: 7076049
... check my comment to your other post
0
 
LVL 1

Expert Comment

by:BigJoe1008
ID: 7097870
For starters

use CGI;
use strict;

CGI will parse out the %20s for you and put spaces there.
Secondly use Tsvetomir's comment and use:

$location =~ s/\s+/\%20/g;

--Joe
0
 

Author Comment

by:celere
ID: 7100833
Thanks I'm still trying. It won't let me
use strict;

it returns:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

If I remove strict the script still executes but stupid NS is still screwing up.

I will give ALL 465 of my points to the first person who can help me edit my scripts, and help me to put everything in order so that I can be sure my calls and functions aren't redundant. I'm not asking you to do the work. This started out as a hobby but now it's not fun any more :(

Please email me at pineatree@hotmail.com

Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:celere
ID: 7178926
This question should have been deleted as it was accidentally duplicated by EE - not me. But since it remains open, the solution was this:

the standard doesn't allow to use space you should replace them with "+" sign

as posted in the original question, which should not have been duplicated.
0
 

Author Comment

by:celere
ID: 7178929
This question should have been deleted as it was accidentally duplicated by EE - not me. But since it remains open, the solution was this:

the standard doesn't allow to use space you should replace them with "+" sign

as posted in the original question, which should not have been duplicated.
0
 

Author Comment

by:celere
ID: 7178931
This question should have been deleted as EE DUPLICATED it when I went to EDIT it. But here are the points. The solution was this:

the standard doesn't allow to use space you should replace them with "+" sign

Thanks Again.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question