Strange php Problem with a + charactor

Folks,

i have a form
it has a drop down select box called ‘No. of bedrooms’ .
the values of it are :

1
2
3

9
10+

now i am posting this form using ajax to a php script.
the ajax js function show 10+. but when php receives the data, it shows 10 only.

whats wrong :rolleyes:

$bedrooms=$_GET['bedrooms'];

pls help :slight_smile:

You need to URLencode the data.

  • in a get request means a space character - ’ '. IF you pass that info as ?bedrooms=10+ then PHP will see that as meaning a space at the end instead.

Thank you so much for the explanation. i understand now :slight_smile:

but i forgot how to do that :rolleyes:

[FPHP]urlencode[/FPHP]

or if this is a static list, %2B is the URL-encoded form of +

Thanks a bunch for the link buddy.
now it works charm.

$bedrooms=urlencode($_GET['bedrooms']);

:slight_smile: