I am getting the following error when I bring a URL with PHP in local to show an image of a "hero". It seems that I am using something obsolete. I've been googling but I do not really understand where the problem is. Can somebody help me?
[Deprecation] Resource requests whose URLs are both removed whitespace ( \n
, \r
, \t
) characters and less-than characters ( <
) are blocked. Please remove newlines and encode less-than characters from places like element attribute values in order to load these resources. See link for more details.
This would be the code I'm using for the hero (in a separate template):
<div class="container pt-4">
<div class="row no-gutters">
<div class="col-12 hero">
<img src="img/<?php echo ($imagen) ? $imagen : $titulo . '.jpg'; ?>" class="img-fluid">
<h2 class="text-uppercase d-none d-md-block"><?php echo $titulo; ?></h2>
</div>
</div>
</div>
And this is the beginning of the code of the page (We) where I get the error.
<?php
$titulo = 'nosotros';
include 'templates/header.php';
include 'templates/hero.php';
?>
<div class="container pt-4">
<div class="row">
<main class="col-lg-8 contenido-principal">
<h2 class="d-block d-md-none text-uppercase text-center"><?php echo $titulo; ?></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed convallis ac risus sit amet condimentum. Duis pellentesque vitae erat a varius. Donec tincidunt, risus sit amet varius tincidunt, turpis arcu ullamcorper ligula, at feugiat turpis massa vitae erat. Nam sit amet posuere urna. Mauris consequat elit in tellus fringilla, in mollis dolor feugiat. Vivamus fringilla eros sed leo maximus rhoncus. Phasellus sit amet vehicula diam. Pellentesque ut lorem ex. Donec sed accumsan velit.</p>
Comment that the name of the image that I want to show in .jpg is called the same as the title of the page to save in code.