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


RE: Receiving Curl POST data.

From: B Z <>
Date: Thu, 06 Jul 2006 20:29:24 -0700

Try adding an echo at the end, like so:

$post = Array();
$post[1] = urlencode('test1');
$post[2] = urlencode('test2');
$post[3] = urlencode('test3');

$curl = curl_init("post.php");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($curl);

ECHO $response;

From:  Josh <>
Reply-To:  curl with PHP <>
Subject:  Receiving Curl POST data.
Date:  Thu, 6 Jul 2006 00:35:43 +0000 (UTC)
>I have been attempting to create some software that requires a login,  with
>  php/gtk.  I am using a site that only allows local connections to my
>mysql database using localhost with scripts that are connected.
>This software will be a .exe when finished so I need a way of
>passing variables to a script online.  I started looking at CURL
>in PHP.  I made a sample script from something I found online,
>but when executed I get a blank page.
>Can anyone suggest what I am doing wrong?
>Here is the script for the first page:
>$post = Array();
>$post[1] = urlencode('test1');
>$post[2] = urlencode('test2');
>$post[3] = urlencode('test3');
>$curl = curl_init("post.php");
>curl_setopt($curl, CURLOPT_POST, 1);
>curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
>$response = curl_exec($curl);
>************************************END FIRST SCRIPT
>Here is the post.php script:
>$p = $_REQUEST['post'];
>echo "CONTENTS:";
>echo "$p";
>****************************END SECOND SCRIPT
>This code is rediculously simple looking...
>I even tried $_POST['post'] instead of request but nothing
>came out on the page when executed....
>I found this earlier and I just need help to figure out what is
>wrong and then I can go from there and
>develop my more advanced script..
>Can anyone help?

Received on 2006-07-07