Solved

stupid NS won't pass white spaces

Posted on 2002-06-10
6
174 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Check file date before getting folder path 1 64
File Find regex problem 4 60
Perl Frameworks 1 81
Perl Write to Specific line in a file 15 76
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.…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

15 Experts available now in Live!

Get 1:1 Help Now