Question about http POST

Macs Bank

Client
Регистрация
25.04.2014
Сообщения
59
Благодарностей
3
Баллы
8
This is driving me crazy. I'm sure its very simple.

Lets assume I have a zenno variable called STRING1.
The string variable has some html in it such as "mary & bill".

Lets say I want to use http post to submit the variable string to a php script that is adding it to mysql for me.

When I use http_post with urlencoded and use the data like this:

string1={-Variable.string1-}&string2={-Variable.string2-}

For some reason, it isn't passing the entire variable to my script. It is only passing "mary" instead of the entire thing.

Can someone help me figure out what I'm doing wrong.

Thanks!!
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 241
Благодарностей
5 848
Баллы
113
I suppose because "&" used as separator between paramters in post request.
You should remove this - "&". Spaces will be urlencoded by the program itself when sending post request.
 

Macs Bank

Client
Регистрация
25.04.2014
Сообщения
59
Благодарностей
3
Баллы
8
Thanks for the reply.

Yeah, I figure that was the issue, but wasn't sure if there way a way to encode it differently or something else? I can easily use a "replace" command to get rid of it or change it to something else, but that is just one example, there are a ton of other htmlspecialchar's that I would have to convert as well....
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)