Solved

stupid NS won't pass white spaces

Posted on 2002-06-10
6
191 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
[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
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
Independent Software Vendors: 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!

 
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

Industry Leaders: 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!

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
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…

749 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