html - How do I echo slashes in php? -
everytime check html output of piece of code, slashes aren't included. thus, background image fails. put through html php converter. im lost; please help.
while($row = mysql_fetch_array($data)) { //echo theme template on pages echo "<div style='background-image:url('../uploads/avi/{$row['avi']}')></div>"; echo "<div class='myname'>{$me}</div>"; }
the simplest answer be, have unclosed '
on style attribute..
echo "<div style='background-image:url('../uploads/avi/{$row['avi']}')'></div>";
^here
but wouldn't work is.. should adjust quotes this:
echo "<div style='background-image:url(\"../uploads/avi/{$row['avi']}\");'></div>";
you can see broken echo http://codepad.viper-7.com/cgmdux
and edited 1 here http://codepad.viper-7.com/beykfz
i passed through htmlspecialchars on codepad can see string , avoid being rendered html viewing purposes only..
Comments
Post a Comment