Jump to content
Sign in to follow this  
Portekoi

Différence cURL et Formulaire?

Rate this topic

Recommended Posts

Bonjour,

Quelles sont les différences entre les 2 scripts ci-dessous. Lorsque j'utilise le formulaire HTML, j'ai une erreur de paramètre que je n'ai pas avec cURL.

Pourtant, tout me semble identique... Qu'ai je manqué?


<?php
$headers = array('User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3');
$param_post = "VERSION=00104&DATEQ=09042012115503&TYPE=53&NUMQUESTION=0001001153&SITE=1111111&RANG=01&CLE=XXXXXXX&AUTORISATION=&MONTANT=5700&DEVISE=978&REFERENCE=BSI_659451_227618&REFABONNE=BSI_659451_227617&PORTEUR=SLDLrcsLMPC&DATEVAL=1212&CVV=123&ACTIVITE=027&ARCHIVAGE=&DIFFERE=000&NUMAPPEL=&NUMTRANS=";
$ch = curl_init("https://ppps.paybox.com/PPPS.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param_post);
if(curl_error($ch)){
// echo "<hr>aaa";
return false;
}else{
// echo "<hr>bbbb";
echo curl_exec($ch);
}
?>
<form action="https://ppps.paybox.com/PPPS.php" method="post" name="ppps_paybox" id="ppps_paybox" style="margin:0;padding:1px;">
<div style="display:block;clear:both;height:0;line-height:0;"></div>

<input type="hidden" name="VERSION" value="00104" />
<input type="hidden" name="DATEQ" value="09042012115503" />
<input type="hidden" name="TYPE" value="53" />
<input type="hidden" name="NUMQUESTION" value="0001001153" />
<input type="hidden" name="SITE" value="1111111" /><!-- config site/banque -->
<input type="hidden" name="RANG" value="01" /><!-- config site/banque -->
<input type="hidden" name="CLE" value="XXXXXXX" />
<input type="hidden" name="AUTORISATION" value="" />
<input type="hidden" name="MONTANT" value="5700" />
<input type="hidden" name="DEVISE" value="978" />
<input type="hidden" name="REFERENCE" value="BSI_659451_227618" />
<input type="hidden" name="REFABONNE" value="BSI_659451_227617" />
<input type="hidden" name="PORTEUR" value="SLDLrcsLMPC" />
<input type="hidden" name="DATEVAL" value="1212" />
<input type="hidden" name="CVV" value="123" />
<input type="hidden" name="ACTIVITE" value="027" />
<input type="hidden" name="ARCHIVAGE" value="" />
<input type="hidden" name="DIFFERE" value="000" />
<input type="hidden" name="NUMAPPEL" value="" />
<input type="hidden" name="NUMTRANS" value="" />


<input type="submit" value="cliquez ici" name="ppps_paybox_submit" />

</form>

Je vois vraiment pas se qui peut clocher :(

Merci :)

Portekoi

Share this post


Link to post
Share on other sites

name="ppps_paybox_submit" dans ton submit, essaie de l'enlever, j'ai pas regardé dans le détail mais j'imagine que ce paramètre n'est pas attendu, il faut peut-être que le nombre de paramètres POST matche exactement.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...