11Tami Posted September 23, 2007 Share Posted September 23, 2007 Hello, I'm trying to rotate an image into a background using php. Whats the correct way to add the php image tag to the background url? This isn't working. <?php echo "<body style='background: url(<img src="/$imagefile">);'>";?> Please let me know, thank you. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 23, 2007 Share Posted September 23, 2007 Rotate? that has nothign to do with rotation what you wrote, nor does it require a lot of knowledge of php <body style='background: url(<img src="<?php echo $imagefile;?>");'> Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 23, 2007 Share Posted September 23, 2007 The correct CSS for a background image is background: url('image url'); no img src, that is html. Quote Link to comment Share on other sites More sharing options...
11Tami Posted September 23, 2007 Author Share Posted September 23, 2007 I need to someone to see this who knows what I am trying to do. Here is php for background images. <?php echo "<body style='background: url(http://www.website.com/a.gif);'>";?> I need to put a php image tag into the url( ) so that it puts the images I want into it with php. Maybe I need to put the whole "<body style='background into a variable instead? Someone who knows a lot about php, please let me know, thanks very much. Quote Link to comment Share on other sites More sharing options...
deadimp Posted September 23, 2007 Share Posted September 23, 2007 If you want to use CSS, be sure you know how to use CSS. Be sure to know the right question to ask. It looks like you know what to do with PHP, and I'll just elaborate with correct CSS, like jesirose said: <body style="background: url('<?=$image?>')"> You need to have short tags enabled for PHP on your server, and it should be. If not, use <?php echo $image php?>. Quote Link to comment Share on other sites More sharing options...
11Tami Posted September 23, 2007 Author Share Posted September 23, 2007 If you read through my post I never said anything about css, I needed php. That was it deadimp thanks a lot. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 23, 2007 Share Posted September 23, 2007 It doesn't matter what you said, your CSS was not valid code. Quote Link to comment Share on other sites More sharing options...
trq Posted September 23, 2007 Share Posted September 23, 2007 If you read through my post I never said anything about css, I needed php. PHP is not responsible for any of what your trying to do. PHP outputs strings, how those strings are formatted depends on the html and css. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.