PHP Abarque div and span

0

good day community, I have a problem:

I want a div and span to be inside PHP, since they perform a function and I need it, or with some other method to make it work.

	    <div class="alert"> 
  <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span> 
  <?php
  $quediaes=date("D");
$quehoraes=date("G");
$minutos = date("i");
$fecha = getdate();
$hora = $fecha["hours"];

if ($quediaes=="Sat" && 15 <= $hora && $hora <= 17 ) {
   echo '<h3>Ahora EN VIVO:</h3><a href="https://dominio.com">Alemania - Suecia</a>';
}

This would need:

 <?php
	    <div class="alert"> 
  <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span> 
 
  $quediaes=date("D");
$quehoraes=date("G");
$minutos = date("i");
$fecha = getdate();
$hora = $fecha["hours"];

if ($quediaes=="Sat" && 15 <= $hora && $hora <= 17 ) {
   echo '<h3>Ahora EN VIVO:</h3><a href="https://dominio.com">Alemania - Suecia</a>';
}

PS: So, I want that "alert" to be shown with the style shown every certain hour, which is already configured as you can see.

    
asked by AFPHP 23.06.2018 в 22:26
source

1 answer

0

If it is that only the div appears when it meets the condition:

 <?php
      $quediaes=date("D");
    $quehoraes=date("G");
    $minutos = date("i");
    $fecha = getdate();
    $hora = $fecha["hours"];

  if ($quediaes=="Sat" && 15 <= $hora && $hora <= 17 ) {?>

    <div class="alert"> 
      <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span> 
      <h3>Ahora EN VIVO:</h3><a href="https://dominio.com">Alemania - Suecia</a>
</div>
  <?php  } ?>
    
answered by 23.06.2018 в 23:01