0
I did the following
echo"<div class='carousel-item active' style='background-image: url('img/intro-carousel/". $row["img_pag_princ_car"] . "')>"
But the following is returning:
<div class="carousel-item active" style="background-image: url(" img="" intro-carousel="" 01_gigaclima_indoor.jpg')="">
What am I doing wrong? Why are you replacing the /
for ?
Better [Dit] and post a better context of your application. It may be some template engine, something dealing with the output buffer, some configuration, framework acting in another part of the code (otherwise the quotes would not be changed in the output). The way it is, just with what you have in the question, you can’t reproduce the problem. We need more details or a [mcve]. - And to make matters worse, you are using simple quotes incorrectly in the HTML part, a good start would be to fix this (applying to the
style
and to theurl
insidestyle
).– Bacco
There’s something strange. In your code you have
class='carousel-item active'
and on the way outclass="carousel-item active"
, Either the output is not from this code or this is not the only code that is generating this output.– Pagotti
the problem is that here
url('
quote closes the attributestyle
, so the mistake, but not quite sure how to fix, tries to escape with so:url(\" ... \")
double-quote– Costamilam