It worked!!! Thanks VERY much. Now if someone could explain to me the difference between urlencode and rawurlencode. In the manual, it states that both are similar (but not the same), urlencode will encode spaces into '+' wherelse rawurlencode does not.
Hence, in my below purposes, which should I be using? <snip> It would probably be better to pass the actual column names instead of the alias. </snip> As for the above comment, I don't believe that I can as I'm actually using the SQL statement to put the alias and getting the alias to be spitted out using mysql_field_result. But I'm open to how to make the code better.. ideas?.. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -----Original Message----- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 7:17 PM To: Ow Mun Heng Cc: [EMAIL PROTECTED] Subject: Re: [PHP] $_GET['sort'] & argument separator 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=ASC The 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php