Solved

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

Posted on 2002-06-13
6
159 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
  • 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now