How can we submit a GET Value to Php that has special characters such as & in it?
So as you know a GET uses the character & and ? to separate each item of the GET value.
How can we then submit a GET value that has these special characters in it while having multiple values with the values of course separated with ? and & ?
FYI, we offer a non-profit search engine and the queries with these special characters are breaking apart when ? and & are included in them, such as:
b&b london uk
Gandalf, Thanks. That solved the problem
You know what it is interesting is that after you URLencode a string in the URL, when Php reads it via GET it reads it without the encoding! So you have to encode it on each append into GET
Technically speaking PHP decodes the GET parameters, making it possible to pass “reserved” characters (like & and #) through GET parameters in the first place
how do we encode a URL in JavaScript for it to pass it to Php via AJAX for processing?
So we have lets say following URL on client side, that needs to be sent via AJAX to Php:
analyzer.php?new_client=195470&desc_brief=The Best Air b & b in Dublin&
kw_rx=Airbnb, Airb&b Data, Air b & b Analytics, Dublin Listings, Airbnb Occupancy Rates, B & B rooms Dublin
How do we encode this in JS so that it can be passed via AJAX to Php and then how do we decode it on Php side?
Thanks. That did the Job nicely
Now People can search with ? & etc. in their searches & can submit Sites for Indexing with same characters in them etc. etc.
And it took only 1 day to update this. But when you are a tiny search engine, doing 100 peoples Job, you really need to balance so many balls in the air. Anyway,Thank U all