I've been looking at a cURL tutorial that suggests using this code :
$cmd = "../../cgi-bin/modulev2.cgi $PBX";
echo $cmd;
$curlPost = urlencode($cmd);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '../../cgi-bin/modulev2.cgi');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($ch);
echo $data;
curl_close($ch);
I'm trying to simulate this form
echo "<form name=\"form\" id=\"form\" action=\"../../cgi-bin/modulev2.cgi\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"PBX_MODE\" value=\"1\"> <!-- passage par formulaire --><br>\n";
echo "<input type=\"hidden\" name=\"PBX_SITE\" value=\"".$PBX_SITE."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_RANG\" value=\"".$PBX_RANG."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_IDENTIFIANT\" value=\"".$PBX_IDENTIFIANT."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_TOTAL\" value=\"".$PBX_TOTAL."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_DEVISE\" value=\"".$PBX_DEVISE."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_CMD\" value=\"".$PBX_CMD."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_PORTEUR\" value=\"".$PBX_PORTEUR."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_RETOUR\" value=\"".$PBX_RETOUR."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_EFFECTUE\" value=\"".$PBX_EFFECTUE."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_REFUSE\" value=\"".$PBX_REFUSE."\"> <br>\n";
echo "<input type=\"hidden\" name=\"PBX_ANNULE\" value=\"".$PBX_ANNULE."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_TXT\" value=\"".$PBX_TXT."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_WAIT\" value=\"".$PBX_WAIT."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_BOUTPI\" value=\"".$PBX_BOUTPI."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_BKGD\" value=\"".$PBX_BKGD."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_LANGUE\" value=\"".$PBX_LANGUE."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_ERREUR\" value=\"".$PBX_ERREUR."\"><br>\n";
echo "<input type=\"hidden\" name=\"PBX_TYPECARTE\" value=\"".$PBX_TYPECARTE."\"><br>\n";
//echo "<input type=\"submit\" name=\"bouton_paiement\" value=\"paiement\"> <br>\n";
echo "</form>\n";
what is supposed to happen is that the cgi module gets the vars and then sends the user on into the payment pages on the payment server
here, however, nothing happens and i get this output in the $data variable
HTTP/1.1 200 OK Date: Wed, 02 Apr 2008 14:29:35 GMT Server: Apache X-Powered-By: PHP/4.4.8 Vary: Host Transfer-Encoding: chunked Content-Type: text/html
have i not understood something ?