| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | preg_replace help needed! lol this dosen't seem to work: PHP Code: 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 |
| |
| | THREAD STARTER #3 (permalink) |
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | will have a go... stand by nope - even as: PHP Code: I think it could have something to do with the fact that it is "word+word" in the querystring, but not in a variable or something... anyone got any ideas or a better way of going about it? |
| |
| | #5 (permalink) |
| NamePros Regular Join Date: Mar 2006
Posts: 397
![]() | |
| |
| | #6 (permalink) |
| NamePros Member Join Date: Apr 2005
Posts: 117
![]() ![]() | Sorry, I meant you have to url_encode the $_GET[old_q] variable before the replace because the server string will have it encoded, and the get superglobal will have it decoded! So simply change: PHP Code: PHP Code: |
| |
| | THREAD STARTER #7 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | aha! works - You are a lifesaver! ![]() have some rep
| ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |