+1234567 ends up being 1234567... where is the plus?

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?

Answers


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' }
});

Need Your Help

How to access data from WordPress database using JSON in Android?

android json database wordpress

I am new in android and I am developing an application in which I have to use a built in database of WordPress.

How to route urllib requests through the TOR network?

python urllib tor

How to route urllib requests through the TOR network?