Re: $_GET['sort'] & argument separator
| From: | John W. Holmes | Date: | Mon, 28 Jul 2003 11:16:38 +0000 |
| Subject: | Re: $_GET['sort'] & argument separator | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157164@lists.php.net to get a copy of this message | ||
Ow Mun Heng wrote:
Hi, I have this problem, which could easily be solved through a name change but I would like to learn more. There's a table set up from a MySQL query like this row1) Eval # Title # Heads My Findings row2) P1000 Title1 6 This is my findings row3) P1223 Eg 2 3 2nd findings row1 is the header columns, the title names are derived from sql statement executed as SELECT eval_no as "Eval #" etc.. row1 is also set up such that if the user clicks the link, it will trigger a SQL comand to sort it. The problem here is the '#' sign/key. spaces are no problem. the $_GET['sort'] is not able to get the whole field, as such "Eval #" can only be recognised as "Eval" and thus sql is not able to sort it. [snip]
This is how the link looks like http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%20 #&dir=ASCThe string with the # character needs to be run through urlencode() or rawurlencode(). The # character is making your browser look for a bookmark named "&dir=ASC" on the view_set_tracker.php page. It would probably be better to pass the actual column names instead of the alias. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com