Yo tengo el siguiente Script:
<?php
$url = "http://www.venedata.com/clientes/includes/api.php"; # URL to WHMCS API file
$username = "username"; # Admin username goes here
$password = "password"; # Admin password goes here
$Minvoiceid = $_GET['invoiceNumber'];
$Mtransid = $_GET['confirmationNumber'];
$Mamount = $_GET['totalAmount'];
$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "addinvoicepayment";
$postfields["invoiceid"] = $Minvoiceid;
$postfields["transid"] = $Mtransid;
$postfields["amount"] = $Mamount;
$postfields["gateway"] = "mercantil";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$data = explode(";",$data);
foreach ($data AS $temp) {
$temp = explode("=",$temp);
$results[$temp[0]] = $temp[1];
}
if ($results["result"]=="Operacion Exitosa") {
# Result was OK!
} else {
# An error occured
echo "El Siguiente Error ha Ocurrido: ".$results["message"];
}
?>
Quisiera hacer lo siguiente, que en la respuesta correcta me redireccione a una pagina "X"
Agradeciendo la ayuda que me puedan brindar
Saludos