Firefox PHP

Why do Phorum's URLs use comma-separated arguments?

Posted by miles 
Why do Phorum's URLs use comma-separated arguments?
August 10, 2007 03:59PM
Why do Phorum's URLs use comma-separated arguments? It makes it difficult, when writing add-ons, to use PHP functions like parse_str. AJAX libraries like jQuery and prototype tend to have functions that compose &-delimited query strings, too. So what's the advantage?
Re: Why do Phorum's URLs use comma-separated arguments?
August 10, 2007 05:17PM
Why Phorum does create its own query string this way? It's very compact, guaranteed to work on any system and we have full control over extremely predicable URLs. Also, by not using the "standard" &/= query string, it is possible to easily wrap the Phorum parameters inside a script.php?phorum=<phorum params>&other=param type of URL (which is for example useful for portable and embedded Phorum). I suspect that Brian might have some additional good reasons for using this type of query string format.

From a Phorum point of view: why use parse_str and not work with the Phorum provided $PHORUM["args"] array? If you are writing a Phorum addon then it makes sense to comply to the Phorum toolset.

But if you want to generate & delimited query string, then where is the exact problem? What is the type of URL handling where you are running into problems? Is it only because those libraries have functions to generate URLs? Why not generate a comma separated query string yourself after all? If you write an addon, you can simply use & query strings, can't you? You can easily provide Phorum with a custom query string, which you compose yourself from your code before invoking Phorum code (see portable code on how to set a custom query string). There are a lot of possible solutions, so if you share your exact problem, we might be able to help you with a solution or at least a work around.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Why do Phorum's URLs use comma-separated arguments?
August 12, 2007 02:49AM
The reasons Maurice mentions above are all true. Its compact and we wanted to handle query string parsing ourselves. When Phorum 5 was started, register_globals was still wide spread and this was one way I could ensure that Phorum would be less hampered by it.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Sorry, only registered users may post in this forum.

Click here to login