Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: pass var in URL with spaces?

by arunhorne (Pilgrim)
on May 25, 2002 at 19:02 UTC ( [id://169291]=note: print w/replies, xml ) Need Help??


in reply to pass var in URL with spaces?

As an aside to your question I note that your parameters do not seem to be arbitrary. Can I suggest enumerating them, i.e. 0 for none, 1 for yes, 2 for no, 3 for yes and no.

The benefits of this are 2 fold... firstly you won't have to use URL encoding as it is guaranteed there are no spaces and secondly it will be harder for an individual to tamper with your URL as parameter meanings will be less verbose- how important this second point is depends on your view of security/purpose of the script.

If you create two subroutines: enum_param that takes a string (e.g. yes) and returns the number representing it and decode_param that reverses this. These will make it easy to use this process in more than one script.

Its only a thought and in many cases it might just be easier to URL encode. Hope it helps.

____________
Arun

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://169291]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-25 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found