Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/11/2007, 04:06
core_2duo
 
Fecha de Ingreso: marzo-2007
Mensajes: 113
Antigüedad: 17 años, 2 meses
Puntos: 0
Problema para recoger datos de formulario (global $HTTP_POST_VARS)

Tengo un problema al ejecutar un codigo que me ha facilitado mi entidad bancaria para hacer la TPV virtual, ya que las variables de un formulario html que se le mandan al script php no le llegan y me temo que puede ser por "global $HTTP_POST_VARS;" aunque no se bien porque

Ya que no tienen soporte para este tipo de consultas por eso os pregunto a vosotros. A continuación os muestro del formulario y el script que me mandaron:

Codigo formulario html
Código PHP:
<html>
<
head><title>Empres</title></head>  
<
body>
   <
form name="form1" method="post" action="pago.php">
      <
table width="55%">
         <
tr>
            
      <
td colspan="2"> <h2>Empresa</h2>
            </
td>
         </
tr>
         <
tr>
            <
td>Titular: </td>
            <
td><input type="text" name="titular" value="titular"></td>
         </
tr>
         <
tr>
            <
td>Importe: </td>
            <
td><input type="text" name="importe"></td>
         </
tr>
         <
tr><td><input type="submit" value="Pagar"></td></tr>
      </
table>

   </
form>
</
body>
</
html
Codigo script php
Código PHP:
<?PHP
<?PHP
// If form is submitted with all required data then show the form
// else show error page
//$importe=230;
empty($Formulario) ?
     
ShowForm($importe,$titular):
     
ShowError();
exit;
?>

<?PHP
.......
.......
//Algoritmos de encriptacion


function ShowError () {
echo 
"<html><head><title>Results</title></head><body>
<table width=100% height=50%><tr><td>
<p><h2><center>Compruebe que todos los datos del formulario son correctos!!</center></h2></p>
</td></tr></table>
</body></html>\n"
;
# End of function ShowResults

function ShowForm ($importe,$titular) {
// Posted data
global $HTTP_POST_VARS;

// Now, print the HTML script
$url 'https://sis.sermepa.es/sis/realizarPago';
echo 
"<html><head><title>Comercio Simulador</title></head>
<body bgcolor=white>
<form name=form1 action=$url method=post>"
;
$order uniqid(1);
$order '1234' substr($order1,9);
$code 'codemio';
$currency '978';
$clave 'clavemia';  //
$importe $importe*100;
echo 
"
<input type=hidden name=Ds_Merchant_Amount value=$importe>
<input type=hidden name=Ds_Merchant_Titular value=$titular>
<input type=HIDDEN name=Ds_Merchant_ConsumerLanguage value=001>
<input type=HIDDEN name=Ds_Merchant_Currency value=$currency>
<input type=HIDDEN name=Ds_Merchant_Order value=$order>
<input type=HIDDEN name=Ds_Merchant_MerchantCode value=$code>
<input type=HIDDEN name=Ds_Merchant_Terminal value=001>
<input type=HIDDEN name=Ds_Merchant_ProductDescription>
<input type=HIDDEN name=Ds_Merchant_MerchantURL>
<input type=HIDDEN name=Ds_Merchant_MerchantName value=Empresa>"
//

// Compute hash to sign form data
// $signature=sha1_hex($importe,$order,$code,$currency,$clave);
$sha = new SHA;
$message $importe.$order.$code.$currency.$clave;
$digest1 $sha->hash_string($message);
$signature strtoupper ($sha->hash_to_string$digest1 ));

echo 
"<input type=hidden name=Ds_Merchant_MerchantSignature value='$signature'>
<center><script language=javascript>document.form1.submit();</script></center>
</form>
</body></html>"
;
# End of function ShowForm
?>
...