CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Query String Spaces

 



andy7t
User

Aug 20, 2003, 10:09 AM

Post #1 of 6 (811 views)
Query String Spaces Can't Post

Hello,
I've got a problem with query strings.

If the query string is: something with a space
Then it turns out like this:
script.pl?something%20with%20a%20space

As you can imagine this can be real problem.
Normally, i would just 'split'. But in this case i don't know how many words there will be- there could even be just 1 word.

Thanks


Paul
Enthusiast

Aug 20, 2003, 5:25 PM

Post #2 of 6 (807 views)
Re: [andy7t] Query String Spaces [In reply to] Can't Post


Quote
As you can imagine this can be real problem.


No...why?


Quote
Normally, i would just 'split'. But in this case i don't know how many words there will be- there could even be just 1 word.


Not really sure what you are asking?


davorg
Thaumaturge / Moderator

Aug 21, 2003, 1:15 AM

Post #3 of 6 (804 views)
Re: [andy7t] Query String Spaces [In reply to] Can't Post

If you use the functions from CGI.pm for getting the parameters from the query string then all of the URL-encoding will be undone for you so you don't need to worry about it.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


andy7t
User

Aug 22, 2003, 5:01 AM

Post #4 of 6 (797 views)
Re: [Paul] Query String Spaces [In reply to] Can't Post

This would be a real problem because:

open FILE, "data/should be this.txt";

open FILE, "data/should%20be%20this.txt";



There not the same.


davorg
Thaumaturge / Moderator

Aug 22, 2003, 6:27 AM

Post #5 of 6 (794 views)
Re: [andy7t] Query String Spaces [In reply to] Can't Post


In Reply To
This would be a real problem because:

open FILE, "data/should be this.txt";

open FILE, "data/should%20be%20this.txt";


There not the same.


It's not a problem because you will never see the version with the IRL encoding if you are using the right tools (i.e. CGI.pm).

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


andy7t
User

Aug 22, 2003, 9:18 AM

Post #6 of 6 (793 views)
Re: [davorg] Query String Spaces [In reply to] Can't Post

Sorry, no this reply was not directed to you.

Paul said why would this be a problem- i was just pointing out that with lots of %20 in your files names it won't work.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives