<?


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


$consulta3 = $conn->query($sql3);


while ($row3 = $consulta3->fetch_assoc())


{


$ID = $row3["ID"];


$img = $row3["img"];



$url = $row3["url"];


$carpetafoto1 = $row3["carpetafoto"];

?>
   <?php   if ($url == NULL) {?> <a class="col-xs-12 col-sm-12"  id="imagensidebar"  data-lightbox="example-set" href="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/resize_<?php echo $img ?>.jpg" >

   <? } else { ?><a class="col-xs-12 col-sm-12" id="imagensidebar" href="<?php
	$url = str_replace('https:', '',  $url);
	$url = str_replace('http:', '',  $url);
	echo $url; ?>" target="_blank"><?php };?><img alt="PUBLICIDAD" class="img-responsive example-image" align="middle" width="100%"  border="0" src="<? echo $dom;?>/<?php echo $carpetafoto1 ?>/resize_<?php echo $img ?>.jpg" /> <?php   if ($url == NULL) {?> </a> <?php } else { ?> </a> <?php };?>
 <?php }


$consulta3->free_result();

?>
