Pound sign in submitted URL query string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JustChuck
Forum Newbie
Posts: 1
Joined: Sat Dec 31, 2005 1:55 pm

Pound sign in submitted URL query string

Post by JustChuck »

We have a client that wishes to transmit data to us via a URL. The problem is the string may contain the pound sign(#). As expected, all data following this is blocked in our PHP script. I've tried cleaning up the URL before grabbing the variables with preg_replace and str_replace on the query as $_SERVER['QUERY_STRING'], but no luck. Is there a way to clean up the incoming URL -- remove the "#" -- and grab all the variables?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Tell him to take care of it in his end by using urlencode()

urlencode turns # to %23 for example, this is what standards are for
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
Perhaps it's better to

- use POST instead of GET
- write headers directly without hidden (e.g. form) data
- or perhaps best: use sockets (+https).

djot
-
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

It took me a while to figure out how i could allow a user to post xml to my php script, but here it is anyway:
service

And here is the client that i've used to test it:
client
Post Reply