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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • leegold2

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

    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_t est2.php?key_wo rd=$key_word&pa ge=" . ($page - 1)
    .. "\">Previou s</a>";

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

    Thanks,
    Lee G.
  • steve

    #2
    Re: Strange GET results - maybe I need rawurlencode() help ple

    "leegold2" wrote:[color=blue]
    > How do I use rawurlencode()? A snippet would extremely appreciated.
    > I read I should use it twice for plus signs(?) - I need help![/color]
    Thanks.[color=blue]
    >
    > 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[/color]
    maintain[color=blue]
    > 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_t est2.php?key_wo rd=$key_word&pa ge=" .
    > ($page - 1)
    > .. "\">Previou s</a>";
    >
    > Then:
    > $key_word = $_GET[’key_word’];
    > $page = $_GET[’page’];
    >
    > Thanks,
    > Lee G.[/color]

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

    echo "<a href=\"search_t est2.php?key_wo rd=" . urlencode($key_ word)
    "&page=" . ($page - 1)
    .. "\">Previou s</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

    Comment

    • leegold2

      #3
      Re: Strange GET results - maybe I need rawurlencode() help ple


      Steve, thanks. I did your recommendation and it works!
      [color=blue]
      > "leegold2" wrote:[color=green]
      > > How do I use rawurlencode()? A snippet would extremely appreciated.
      > > I read I should use it twice for plus signs(?) - I need help![/color]
      > Thanks.[color=green]
      > >
      > > 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[/color]
      > maintain[color=green]
      > > 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_t est2.php?key_wo rd=$key_word&pa ge=" .
      > > ($page - 1)
      > > .. "\">Previou s</a>";
      > >
      > > Then:
      > > $key_word = $_GET[’key_word’];
      > > $page = $_GET[’page’];
      > >
      > > Thanks,
      > > Lee G.[/color]
      >
      > Leegod, as I indicated in the prior thread (see urlencode below)..
      >
      > echo "<a href=\"search_t est2.php?key_wo rd=" . urlencode($key_ word)
      > "&page=" . ($page - 1)
      > . "\">Previou s</a>";
      >[/color]

      Comment

      Working...