I'm trying get a url from MySQL database and display on <img>
on PHP file, I get url perfect but when I put on background-image:url
always disapear slash bar /
.
My database with url
My code
I get from database url using a query and I put:
my generate code (chrome console)
Why slash bar was disapeared?
Any suggestions?
UPDATE (using another part of code)
You're closing the style attribute with the single quote in the background-url(
. Escaped double quotes for the background-url(
should resolve the issue or only outputting the id and the image location with PHP. With the latter suggestion you can use double quotes for the attribute and single quotes for the background-url
.