Hmm...hombre explicame eso de las cabeceras...
Hasta donde yo conozco, solo hay 2 formas de enviar datos a una página, port POST y por GET. ¿Cómo funciona el HEAD?... fijate que en el manual no aparece nada al respecto. Además, el Sample que ellos proporcionan es super raro, trabaja con POST y GET, pero realmente el servidor no está enviando dichas variables.
Es una documentación bastante vaga...
Fijate en el sample:
Código PHP:
<?
/* IPN PHP Script */
/*
This sample script will read iKobo IPN message, parse it and save it into /tmp/ipn_test.txt
/tmp/ directory is available and allows writing on most Unix systems
*/
function get_var($name, $default='none')
{
return (isset($_GET[$name])) ? $_GET[$name] : ((isset($_POST[$name])) ? $_POST[$name] : $default);
}
$func = get_var('func');
$pwd = get_var('pwd');
$confirmation = get_var('confirmation');
$account_no = get_var('account_no');
$buyer_email = get_var('buyer_email');
$merchant_fee = get_var('merchant_fee');
$tax = get_var('tax');
// if item requires shipping
$firstname = get_var('firstname');
$lastname = get_var('lastname');
$address1 = get_var('address1');
$address2 = get_var('address2');
$city = get_var('city');
$state = get_var('state');
$zipcode = get_var('zipcode');
$country = get_var('country');
// item detail information
$no_items = get_var('no_items');
$item_code = get_var('item_code');
$name_list = get_var('name_list');
$qty_list = get_var('qty_list');
$price_list = get_var('price_list');
$option_list = get_var('option_list');
if(!empty($account_no) && strlen($account_no) >=8)
{
// if valid request the respond with ..
echo "RESP=OK\r\n";
// separate list of options selected for each item into an array
// e.g. color=green+200:Size=small+300, color=red+200:Size=small+400
$item_options = explode(",", $option_list);
$n = count($item_options);
for($i=0; $i<$n; ++$i)
{
// option list for each item
// e.g. color=red+200:size=small+400
$options = explode(":", $item_options[$i]);
$m = count($options);
for($k=0; $k<$m; ++$k)
{
// name, value and extra cost of each option selected for the item
// e.g color=red+200
list($name, $value, $extra_cost) = split('[+=]', $options[$k]);
// .....other code goes here
}
}
$handle = fopen ("/tmp/ipn_test.txt","w");
fputs($handle, $func);
fputs($handle, $pwd);
fputs($handle, $confirmation);
fputs($handle, $account_no);
$others = sprintf("\n no_items %s \n item code %s \n qty_list=%s \n name_list %s\n option list %s\n price list = %s\n",
$no_items, $item_code, $qty_list, $name_list, $option_list, $price_list);
fputs($handle, $others);
fclose($handle);
}
?>
¿?... Ni idea... eso no hace nada.