- Impact
- 18
this dosen't seem to work:
This is a part of the spell checking script on 6YD search.
Can anyone help me? If $_GET['q'] is one word, then the spell check works a dream - ie: http://www.6yd.net/search.php?q=scool&m=web but when you have two words - ie: http://www.6yd.net/search.php?q=scool+lessons&m=web then it spells it correctly in the link's text, but it dosen't correct it in the url. The link and text are in the variable $spelling by the way.
Tom
PHP:
$old_q = urldecode($_GET['q']);
$spelling = "<b>Spelling Suggestion:</b> <a href=\"search.php?".preg_replace("/q=".urlencode($old_q)."/","q=".urlencode($result['ResultSet']['Result']),$_SERVER['QUERY_STRING'])."\">Did you mean <i><b>".$result['ResultSet']['Result']."</b></i></a><br /><br />";
This is a part of the spell checking script on 6YD search.
Can anyone help me? If $_GET['q'] is one word, then the spell check works a dream - ie: http://www.6yd.net/search.php?q=scool&m=web but when you have two words - ie: http://www.6yd.net/search.php?q=scool+lessons&m=web then it spells it correctly in the link's text, but it dosen't correct it in the url. The link and text are in the variable $spelling by the way.
Tom





