This is a discussion on String returned from forms and such within the PHP General forums, part of the PHP Programming Forums category; Good afternoon. I'm having a problem handling strings with spaces being passed from a form by HREF to a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Good afternoon.
I'm having a problem handling strings with spaces being passed from a form by HREF to a PHP program. Example: <A HREF="buttons.php?state_name=New Mexico">button code</A> When the 'New Mexico' gets to phpinfo, it says the string is 'New+Mexico' and that's not what I need. I used htmlspecialchars to add the %20 to the string but didn't get it. What am I doing wrong or missing?? Any help is VERY appreciated!! Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 |
|
|||
|
On Sun, 23 Nov 2003 15:19:23 -0700, you wrote:
>When the 'New Mexico' gets to phpinfo, it says the string is 'New+Mexico' >and that's not what I need. I used htmlspecialchars to add the %20 to the >string but didn't get it. What am I doing wrong or missing?? That sounds like the behaviour of urlencode, not htmlspecialchars. Try rawurlencode. BTW, there is a urldecode function... http://www.php.net/manual/en/ref.url.php |