Hist : siberia problems when GET array manipulated with FORM submit button
Posted by sarneil on 13 Aug 2010 in Activity log
In the site, each page looks at $_GET['lang'] to determine what language to use in the interface (English, French, Russian). In the search page for the image archive, the action on the sbumit button on the form was $_SERVER['REQUEST_URI'] which had a value like index.php or index.php?lang=fren or index.php?lang=fren&q=boat. The problem is that when that action was invoked the entire get array is replaced by the values in the form, and since the form included only a q element, the lang element was lost which meant that the interface reverted to the default (English). The solution to this problem was to add a hidden input element to the form with name lang and value $_GET['lang']. That forced the newly generated URL to include the lang key-value pair as well.