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

curl-and-php

PHP strings to curl

From: Sergej Rinc <sergej_at_rinc.ws>
Date: Wed, 28 Feb 2001 23:02:37 +0100

  Well, it's me again.

  This is driving me nuts: why this

$param1 = "/usr/local/bin/curl -m 120 -d \"";

$param2 = "par1=TRUE&...";
//$param2 = "$postString";
//$param2 = $postString;
//$param2 = substr($postString,0,strlen($postString));

$param3 = "\" --url $URL -L";
$param4 = "-A \"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)\"";

$param = "$param1$param2$param3 $param4";
//$param = $param1.$param2.$param3." ".$param4; - USUAL SYNTAX, WORKS
//$param = "$param1$postString$param3 $param4"; - DOESN'T WORK
//$param = $param1.$postString.$param3." ".$param4; - DOESN'T WORK

exec($param, $return_message_array, $return_number);

  works (setting $param2 string directly, I have left entire $param2 and
$URL) while I cannot get the right result from curl if using any of direct
combination with $postString (this I get parsed from $HTTP_POST_VARS and is
absolutely correct according to GET URL syntax, e.g
http://somesite.com&$postString would work if I would generate an URL).

  The problem is - as you see - POSTing a form on some URL and getting
return results (with parsing it to my needs). I really really don't know
what to do since PHP and Zend manual don't offer any help and setting curl
properties (curl_setopt) doesn't work either as I have allready pleaded for
help before. Of cource running curl on command line alone works but with PHP
I cannot get to push my form parameters to it instead of declaring fixed
ones.

  Gee, I guess I will need to learn Perl because I'm sure it can be done
with it (and curl).

Sergej Rinc, Certified Doc-To-Help Trainer
Master Certified XML Developer, Master Certified HTML Programmer, Master
Certified Dreamweaver 3.0 User, WAP Developer
Member, International Webmasters Association http://iwanet.org
mailto:sergej@rinc.ws, http://sergej.rinc.ws

_______________________________________________
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-28