Hi guys,
Got a small problem for you.
I'm building a small search engine for our Intranet.
People enter the search-criteria in the search form and then it displays the results.
However - I wanted to make it a bit more spiffy by allowing people to use + and - sign to decide if a item must be present or not (or no +/- making it optional).
Example: +Bjorn -Tidal should spit out everything with Bjorn but not Tidal.
However - I got a problem sending the +-sign via the form. Since + is detected as a empty space PHP just can't find any + sign.
I use the code:
<form name="form1" method="get" action="search.php" target="_blank">
<input type="text" name="inetsearch" size="30">
etc.
The resulting url ends up looking like:
search.php?inetsearch=+Björn%20-Tidal
However, when taking out the variable $inetsearch in php it is written as " Björn -Tidal" instead - the + has been turned into a space (which it should since + is a space in a URL like this). I've tried the post method also with the same result.
I notice that Altavista converts the plus-sign into %2B - however, I don't know how to accomplish that? I've tried a eregi_replace but that doesn't work since it doesn't exist in the resulting string ....
Anyone got a simple/smart solution?
/Björn
Webmaster: Anoto AB