Lo que necesito es que este script se ejecute diariamente pero sin darle click en ningun lado, mejor dicho automaticamente, no se si sea posible...
De ante mano muchas gracias a todos.
Este es el codigo del script.
<?php
include_once("parametros.php");
if(!$conexion = mysql_connect($namehost,$user_database,$password_d atabase))
{
printf("No se ha podido realizar la conexión con la base de datos\n");
$error = true;
}
mysql_select_db ($name_database);
$mes = date("n");
$mesname = date("F");
$hoy = date("j");
$hora = date("h : i : s");
$ampm = date("a");
$qry = mysql_query("SELECT * FROM clientes WHERE ((`clientes`.`mes` = '$mes') AND (`clientes`.`dia` = '$hoy'))");
while ($res = mysql_fetch_array($qry)){
$linea = "\"$res[nombre]\", ";
$linea .= "\"$res[correo]\", ";
$linea .= "\"$res[dia]\", ";
$linea .= "\"$res[mes]\"";
$data .= trim($linea)."\n";
$data = str_replace("\r", "", $data);
$codigohtml = '
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
</body>
</html>
';
$email = $res['correo'];
$asunto = 'Feliz cumpleaños '. $res['nombre'];
$cabeceras = "From: administracion@midminio.com\r\nContent-type: text/html\r\n";
//direcciones que recibirán copia oculta
$cabeceras .= "Bcc: xxxxxxxxx@mimail.com\r\n";
mail($email,$asunto,$codigohtml,$cabeceras);
}
?>





Mode Lineal
