使用php echo功能更改背景

I'm trying to use

echo '<body style="background:url(img/backgroundloggedin.jpg) no-repeat";
               >';

In order to change the background image of my page but I'm finding no success doing so. The image won't fill 100% of the page regardless of what I am doing, I have tried no repeat, fixed, 100%

There are a couple things wrong.. 1) you need single quotes ' in your CSS for image url. Two the semicolon ; needs to go IN the double quotes " for the style attribute.

IE

echo '<body style="background:url(\'img/backgroundloggedin.jpg\') no-repeat;">';

NOTES

That I escaped the single quote ' with a forward slash as to not interfere with the php echo statment.

Now that the syntax is correct -- I suggest using a forward slash in front of img if your img directory is in web root. --> IE background:url(\'/img/backgroundloggedin.jpg\')