Solved

stupid NS won't pass white spaces

Posted on 2002-06-10
6
179 Views
Last Modified: 2010-03-05
Argh here we go again.

I've already tried the two solutions posted at qid=20217126.  They worked before, but they don't work today.

I have HREFs, form submission, and javascript <select> redirection all using the same format:

<a href="http://www.mysite.com/cgi/script.cgi?apl::Apple Recipes>Apple Recipes</a>

Then my perl script delimits the query:

$page=$ENV{'QUERY_STRING'};
$page=~s/^page=//;

foreach($page){
  ($shortname,$longname)=split(/::/,$_);
  }

Without fail, NS drops the second part of $longname, and prints only Apple.

Like I said, this was once resolved in qid=20217126 and today I tried both of those solutions. Neither one is working now.

Can you please help me? Thank you thank you thank you.

PS- the solutions offered at 20217126 are:

(1) $company =~ s/ /%20/g;

and

(2)
$company=&my_escape($company);
...

sub my_escape{
 my($text)=@_;
 # Build a char->hex map
 for (0..255) {
   $escapes{chr($_)} = sprintf("%%%02X", $_);
 }
 ##  Regular expression for escaping special chars.
 $text =~ s/([^;\/?:@&=+\$,A-Za-z0-9\-_.!~*'()])/$escapes{$1}/g;

 return $text;
}
0
Comment
Question by:celere
6 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 7067770
you need to write
    script.cgi?apl::Apple Recipes
as
    script.cgi?apl::Apple%20Recipes
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7069024
some servers have + as spaces. check what your server does.
0
 
LVL 6

Expert Comment

by:andreif
ID: 7069249
There is missing quote:

<a href="http://www.mysite.com/cgi/script.cgi?apl::Apple Recipes>Apple Recipes</a>

should read as

<a href="http://www.mysite.com/cgi/script.cgi?apl::Apple Recipes">Apple Recipes</a>
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 12

Expert Comment

by:lexxwern
ID: 7069298
good catch andreif
0
 

Author Comment

by:celere
ID: 7069664
Thanks everyone. Actually that missing closing quote was just a typo here in my post.  My links all had all quotes. And while I don't really believe that hard coding the %20's is the solution (like I said, this worked before), I've resorted to it for now. Thanks again.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7070038
> .. I don't really believe  ..
it works for some browsers (mainly M$ adicted ones)
but read w3c standards: it's not recommended
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

11 Experts available now in Live!

Get 1:1 Help Now