Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2002-06-13
6
Medium Priority
?
167 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 150 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Six Sigma Control Plans

610 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