tags:

views:

101

answers:

1

Hi guys,

Well through jquery i am doing an ajax request to send through a cell number in the format of +1234567 but if i access it on the other end using $_POST['cell']; the plus is gone, where could it be?

+4  A: 

This depends on how you are performing the query.

If you do:

$.ajax({
    url: 'foo.php',
    data: 'cell=+1234567'
});

You will loose the + because it because it has to be URL encoded (+ means space in the URL). I would recommend you this which will take care of encoding:

$.ajax({
    url: 'foo.php',
    data: { cell: '+12345' }
});
Darin Dimitrov
thanks, worked perfectly.
Hailwood