Re: Reading binary http post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the info, it was really helpfull. One question though, is
it necessary to first encode my data with the base64 algo, or can I
skip that step and immediately urlencode my data?

Dirk

On 2/21/06, Richard Lynch <ceo@xxxxxxxxx> wrote:
> You probably should be URL-encoding your data in the first place...
> http://php.net/urlencode
>
> <?php
> $data = "&whatever funky characters you want":
> $data_url = urlencode($data);
>
> //WRONG:
> $URL = "http://example.com/$data";
>
> //RIGHT:
> $URL = "http://example.com/$data_url";;
>
> If it's not feasible for your C++ application to replicate urlencode()
> then you may be able to get what you want with that http_raw_post_data
> stuff.  You'll have to search on php.net for something not unlike "raw
> post data" until you find it, as I don't have the ULR in my head.
>
> But you'd be 100% better off to follow the standards and url-encode
> the data in the first place -- Especially if you're ever going to
> re-use this code elsewhere, and MOST especially if you ever might want
> to hook up YOUR code to another person's server that actually follows
> the standards.
>
> On Tue, February 21, 2006 12:40 pm, Dirk Vanden Boer wrote:
> > Hi,
> >
> > I have a C++ application that posts binary data to a php script that I
> > created using libcurl. Everything works fine except when my binary
> > data
> > happens to start with the '&' symbol. In that case I can't read the
> > http
> > post data (isset returns false).
> >
> > The post argument then looks like data=&ÑÚA
> > Reading the post is done like this:
> > if (isset($_POST['data'])
> > Is there a way to fix this problem?
> >
> > Thanks in advance
> > Dirk
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux