From: Gilles D. <gr...@sc...> - 2002-04-23 18:49:16
|
According to Christopher Murtagh: > On Tue, 23 Apr 2002, Gilles Detillieux wrote: > >According to Ted Stresen-Reuter: > >> 1) You can set the argument separator for php in the php.ini file as in the > >> following: > >> arg_separator.output = ";" > >> arg_separator.input = ";" > > > >If you do this, will PHP still recognize the "&" as a valid argument > >separator as well? Ideally, you'd want a way of configuring it to > >allow either. > > Hi Ted, Gilles, > > Thanks very much for the feedback. I have tested this and am happy to say > that yes it will work for both. In fact, I also tried this: > > arg_separator.output = ",&;" > arg_separator.input = ",&;" > > and this URL: > > http://server/page.php?foo=hey,foobar=there > > worked as expected. OK, so arg_separator.input works as a multiple-choice thingy, where any one single character in the list works as separator (but & works whether in the list or not). What do multiple characters in arg_separator.output mean, though? If it only uses one, which one? If it picks the one that was used for input, if it's in the list, that would be ideal. If it uses the whole string as a separator, though, that's not what you want. How do you test how arg_separator.output works? If I can get to the bottom of what the ideal settings for these are, I'd like to add a note about this to FAQ 5.21. > So, rather than the hack I did to htsearch, all I need to do is change > the config line in my php.ini file (well, I did another hack as well, but > I didn't need to change the ';'). :-) > > So, now my search engine can fetch restrict values from Postgres that is > aware of multiple sites that span across different servers, and I've > hacked htsearch so that it doesn't put the restrict in the page URL > (because it is generated by PHP/Postgres). I then simply have this code: Interesting. Normally, htsearch puts in the page URL any parameter that it received as a CGI or URL parameter initially, so it doesn't propagate parameters that aren't previously passed to it, but it doesn't allow for the case where you'd want to pass it a parameter but not have it passed back. I don't know if this would be a commonly needed feature - I don't recall any earlier requests for it, or complaints about having to hack it out of the code. > if($words){ > > $words = urlencode($words); > $config = preg_replace ("/[^a-z]/","",$config); > $method = preg_replace ("/[^a-z]/","",$method); > $sort = preg_replace ("/[^a-z]/","",$sort); > $matchesperpage = preg_replace ("/[^0-9]/","",$matchesperpage); > $SearchArea = preg_replace ("/[^0-9]/","",$SearchArea); > $page = preg_replace ("/[^0-9]/","",$page); > > print"<!--\n"; // this is to remove the content-type generated for > // CGI compliance, also needed in > // the php.conf file is the end of the comment > // because I'm using passhthru rather than exec > // (faster and no parsing arrays) In 3.1.6, you can turn off the content-type header that htsearch outputs. See http://www.htdig.org/attrs.html#search_results_contenttype -- Gilles R. Detillieux E-mail: <gr...@sc...> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/ Dept. Physiology, U. of Manitoba Winnipeg, MB R3E 3J7 (Canada) |