print image as a background-image The page.tpl.php prints the header image like so. I need to change it so that it prints it as a background image. i.e &lt;div style="background-image:"' . $url . '"&gt;&lt;/div&gt;  When I make that change the value of $url changes and includes additional text, not just the path to the image as it does in this format. How can I change this?

if ($node-&gt;field_header_image &amp;&amp; $node-&gt;field_header_image['und'][0]['uri']) {
        $url = file_create_url($node-&gt;field_header_image['und'][0]['uri']);
        echo '&lt;img src="' . $url . '" width="100%"&gt;';
You are retrieving the absolute url of the file correctly, but your quotes in style attribute are a little mixed up.

Try this:

&lt;?php 
print '&lt;div style="background-image:url(' . $url . ');"&gt;&lt;/div&gt;';
?&gt;