| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Soon to be RICHdoggie! | 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 |
| |
| | #3 (permalink) |
| Soon to be RICHdoggie! | 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? |
| |
| | #6 (permalink) |
| NamePros Member | 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: |
| |
| | #7 (permalink) | |
| Soon to be RICHdoggie! | aha! works - You are a lifesaver! ![]() have some rep Quote:
| |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |