[SOLVED] URL parameter value containg the plus sign?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thavaht
    New Member
    • Aug 2006
    • 12

    #1

    [SOLVED] URL parameter value containg the plus sign?

    I made a link in a dynamic table on a master page to find details of a selected record and display on a detail page, using URL parameter values retrieved from the selected record.
    [PHP]<td><a href="/buscacomp.php?r ecordID=<?php echo $row_conbibliot eca['Signatura']; ?>"><?php echo $row_conbibliot eca['Titulo']; ?></a></td>[/PHP]
    When the parameters Value is a string containing a plus (+) sign the requested record does not return. Is there any problem with the plus sign? Is there a solution?
    Last edited by ronverdonk; Oct 12 '06, 04:59 PM. Reason: closed
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    From the php documentation:
    Description
    string urlencode ( string str )

    Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-www-form-urlencoded media type. This differs from the RFC1738 encoding (see rawurlencode()) in that for historical reasons, spaces are encoded as plus (+) signs.
    Therefore, try:
    Code:
    <td><a href="/buscacomp.php?recordID=<?php echo urlencode($row_conbiblioteca['Signatura']); ?>"><?php echo $row_conbiblioteca['Titulo']; ?></a></td>
    Ronald :cool:

    Comment

    • thavaht
      New Member
      • Aug 2006
      • 12

      #3
      It works! Thanks for all.

      Comment

      Working...