Hola a todos bueno este es es código que tengo:
Código HTML:
<span class="titulo">
<?php $result =mysql_query('SELECT * from '.$_SESSION['tablaIdioma'].' where idtexto=24');
$row = mysql_fetch_array($result);
echo($row[1]);
?></span><br><br><ul style="list-style-image:url(imagenes/bull-cuadrado-azul02.gif)">
<?php
$resultDescargas = mysql_query('SELECT * from descargas where id_user='.$_SESSION['id']);
$rowDescargas = mysql_fetch_array($resultDescargas);
$result2 = mysql_query('SELECT COUNT(*) from descargas where id_user='.$_SESSION['id']);
$row2 = mysql_fetch_array($result2);
if($rowDescargas){
for ($i=0;$i<$row2[0];$i++){
$mensaje= 'El cliente: '.$rowCli[1].' se ha descargado la siguiente actualización: '.$row[1];
$result=mysql_query('SELECT * from aplicaciones where id='.$rowDescargas[0]);
$row=mysql_fetch_array($result);?>
<li><span class="enlace" >
<a href="<?php echo($row[2]);?>" target="_blank" onClick ="<?php if (mail('[email protected]', " Descarga de cliente ",$mensaje)){
echo("javascript:");
echo("alert('lo he enviado');");
}?>" >
<?php echo($row[1]);
?></a></span></li>
<br>
<?php
$rowDescargas = mysql_fetch_array($resultDescargas);
}
}
else{
echo("no hay descargas");
} ?>
</ul>
Bueno pues este código no se porque pero me envia el email por las buenas en vez de esperar a que el usuario pinche en el enlace.
Alguien me podría decir el por qué?
Le estaría muy agradecido.
Gracias a todos por al menos intentarlo. ;)