El problema es que cuando lo llamo no me ejecuta el codigo del php
si en cambio ejecuto el archivo php, este si ejecuta el codigo
Estoy haciendo algo mal en la llamada?
Saludos.
Mariano.
Archivo html
Código HTML:
<html> <head> <title>Documento sin título</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="136" height="102" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="136" height="102"> <?php include("banners.php"); ?> </td> </tr> </table> </body> </html>
Código PHP:
<?
$numbanners = 3; //numero de banners que se rotarán
$random = rand(1,$numbanners);
$img = array();
$url = array();
$txt = array();
$img[1] = "banner1.gif";
$url[1] = "http://www.web.com.ar";
$txt[1] = "Visita el enlace del banner 1";
$img[2] = "banner2.gif";
$url[2] = "http://www.web.com.ar";
$txt[2] = "Visita el enlace del banner 2";
$img[3] = "banner3.gif";
$url[3] = "http://www.web.com.ar";
$txt[3] = "Visita el enlace del banner 3";
echo "<a href='$url[$random]' target='_blank'><img src='$img[$random]' alt='$txt[$random]' border='0'></a>";
?>