By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,712 Members | 1,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,712 IT Pros & Developers. It's quick & easy.

Strange GET results - maybe I need rawurlencode() help please

P: n/a
How do I use rawurlencode()? A snippet would extremely appreciated.
I read I should use it twice for plus signs(?) - I need help! Thanks.

Very strange stuff happens when I use GET to pass
a string like '+high +altitude'. Literally that's my
(a legitimate) test string in a Mysql Boolean Fulltext search.
Other non alplas are also causing strangeness. Not at first
from my user search form, but during pagination of the results,
as I GET the search string to further pages down the line to maintain
state the trouble starts. I think the literal '+' in the string gets
hosed by GET process.

key_word is +high +altitude for example:

echo "<a href=\"search_test2.php?key_word=$key_word&page=" . ($page - 1)
.. "\">Previous</a>";

Then:
$key_word = $_GET['key_word'];
$page = $_GET['page'];

Thanks,
Lee G.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"leegold2" wrote:
How do I use rawurlencode()? A snippet would extremely appreciated.
I read I should use it twice for plus signs(?) - I need help! Thanks.
Very strange stuff happens when I use GET to pass
a string like ’+high +altitude’. Literally that’s my
(a legitimate) test string in a Mysql Boolean Fulltext search.
Other non alplas are also causing strangeness. Not at first
from my user search form, but during pagination of the results,
as I GET the search string to further pages down the line to maintain state the trouble starts. I think the literal ’+’ in the
string gets
hosed by GET process.

key_word is +high +altitude for example:

echo "<a href=\"search_test2.php?key_word=$key_word&page=" .
($page - 1)
.. "\">Previous</a>";

Then:
$key_word = $_GET[’key_word’];
$page = $_GET[’page’];

Thanks,
Lee G.


Leegod, as I indicated in the prior thread (see urlencode below)..

echo "<a href=\"search_test2.php?key_word=" . urlencode($key_word)
"&page=" . ($page - 1)
.. "\">Previous</a>";

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Strange-...ict132986.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=444112
Jul 17 '05 #2

P: n/a

Steve, thanks. I did your recommendation and it works!
"leegold2" wrote:
> How do I use rawurlencode()? A snippet would extremely appreciated.
> I read I should use it twice for plus signs(?) - I need help!

Thanks.
>
> Very strange stuff happens when I use GET to pass
> a string like ’+high +altitude’. Literally that’s my
> (a legitimate) test string in a Mysql Boolean Fulltext search.
> Other non alplas are also causing strangeness. Not at first
> from my user search form, but during pagination of the results,
> as I GET the search string to further pages down the line to

maintain
> state the trouble starts. I think the literal ’+’ in the
> string gets
> hosed by GET process.
>
> key_word is +high +altitude for example:
>
> echo "<a href=\"search_test2.php?key_word=$key_word&page=" .
> ($page - 1)
> .. "\">Previous</a>";
>
> Then:
> $key_word = $_GET[’key_word’];
> $page = $_GET[’page’];
>
> Thanks,
> Lee G.


Leegod, as I indicated in the prior thread (see urlencode below)..

echo "<a href=\"search_test2.php?key_word=" . urlencode($key_word)
"&page=" . ($page - 1)
. "\">Previous</a>";

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.