cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: POSTing '*' (with PHP)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Feb 2001 09:27:19 +0100 (MET)

On Sun, 18 Feb 2001, Sergej Rinc wrote:

(Crossposting to the curl-PHP mailing list)

> This couldn't let me relax today and after several tests now I am now
> convinced that it must be a PHP 'feature'. If I call
>
> /usr/local/bin/curl -m 120 -d "...&name=%27%2A%27&..." my_url -L
>
> (parts removed) from shell I do get a correct response from server.
> Even
>
> /usr/local/bin/curl -m 120 -d "...&name='*'&..." my_url -L
>
> works. But in PHP neither setting curl options neither calling exec
> with the first line above doesn't work, e.g. looks like form parameters
> are not passed from PHP to curl.

Ugha. I wish I knew PHP good enough to understand what's going on under the
hood. It should exist some kind of escape mechanism that prevents PHP from
doing that.

> I guess proper question(s) is then - regarding control characters -:
>
> "How to escape percentage sign when calling shell (bash, from PHP) and
> how to escape percentage sign when passing strings in PHP?"

The percentage sign needs no escaping in bash, as it isn't treated special.
It seems to require escaping from PHP though.

> Anyway, from working with curl from Friday, I can only say that curl is
> one of the best open-source tools for webmasters and others.

*bows*

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-02-19