<?

mysql_connect ("$host", "$usuario", "$contra");


mysql_select_db ("$basedatos");


$sql3 = "SELECT * FROM publicidades WHERE ID = '$ID_publicidad'";


$consulta3 = mysql_query ($sql3);


while ($row3 = mysql_fetch_array($consulta3))


{


$ID = $row3["ID"];


$img = $row3["img"];



$url = $row3["url"];


$carpetafoto1 = $row3["carpetafoto"];

?>
   <?php   if ($url == NULL) {?> <a class=""  id="imagensidebar"  data-lightbox="example-set" href="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/resize_<?php echo $img ?>.jpg" >
   
   <? } else { ?><a class="" id="imagensidebar" href="<?php echo $url; ?>" target="_blank"><?php };?>
	
	<img alt="PUBLICIDAD" class="img-fluid example-image" src="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/resize_<?php echo $img ?>.jpg" /> <?php   if ($url == NULL) {?> </a> <?php } else { ?> </a> <?php };?>
 <?php }


mysql_free_result($consulta3);

?>