Welcome Guest, Not a member yet? Register   Sign In
+ in post?
#1

[eluser]gRoberts[/eluser]
Hi all,

My client has just asked why when he uses an ajax feature i've implemented that it doesn't remember +'s?

The content is escaped prior to being sent and using firebug, it is still there when i call open (ajax) but when its received in the controller and parsed using the input->post (with and without xss), it converts the + to a single space.

Any idea's on how i can overcome this?

Cheers
#2

[eluser]manilodisan[/eluser]
What if you use $_POST instead of $this->input->post?
#3

[eluser]gRoberts[/eluser]
The same my friend. Like in querystrings, + represents a space. As post is passed across like

Code:
param1=My+name+is&param2=gavin

I think it is treated the same. I can't seem to get it to work, i've tried escaping it, I can't seem to find the ascii equiv either.

Thanks

Gav
#4

[eluser]manilodisan[/eluser]
Try to base64_encode the data before sending it to PHP and decode there.
#5

[eluser]gRoberts[/eluser]
Wink good stuff.

The only downside is having to do that...

Thank you !
#6

[eluser]manilodisan[/eluser]
I don't see any downside rather than having to load another js file. base64 was built for things like this.




Theme © iAndrew 2016 - Forum software by © MyBB