Goodfella Posted February 26, 2007 Share Posted February 26, 2007 // The logo, user information, news, and menu. echo ' <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder" style="background: url('.$settings['images_url'].'/left.gif) repeat-y;"><img src="'.$settings['images_url'].'/left.gif" alt="" />; Hi, im trying to repeat an image, but it only appears one time, at the top-left. I want join an image to the border of a table to make it a background. Link to comment Share on other sites More sharing options...
pulpfiction Posted February 26, 2007 Share Posted February 26, 2007 Im not really good in PHP, but guess the error is you need to use <? ?> when you write PHP code......style="background: url('<? .$settings['images_url']. ?>'/left.gif) repeat-y;"> Link to comment Share on other sites More sharing options...
Goodfella Posted February 26, 2007 Author Share Posted February 26, 2007 Humm, i try to use <? ?> but return parse error.Parse error: parse error, unexpected '?' in index.template.php on line 113 Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted February 26, 2007 Share Posted February 26, 2007 The <? ?> should produce an error, as it's already withintags, and a echo!"First change this background: url('.$settings['images_url'].'/left.gif) repeat-y;" to this: background: url(\''.$settings['images_url'].'/left.gif\') repeat-y;" Note the quoted ' (\')...Also make shure that the class tbody doesn't overwrite the background...The PHP seams ok (since you see the images) so this is realy an CSS question...When i took a closer look I found some problems (at least in the version you display here..):First you don't end the string!Second: you can't put an image directly in an table!This is better: echo "\n\n".'<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder" style="background: url(\''.$settings['images_url'].'/left.gif\') repeat-y;">'."\n";echo '<tr><td><img src="'.$settings['images_url'].'/left.gif" alt="" /></td></tr>'; Then I don't get why you use the backround in the table as an "alone image"... it can't look good..Hope that helps!Good Luck and Don't Panic! Link to comment Share on other sites More sharing options...
Goodfella Posted February 26, 2007 Author Share Posted February 26, 2007 Ok, thx for the tip.I think if you can see my forum its more easier to understand or to explain myself.http://forum.pt-sys.netIm trying to put an image with repeat-y in the left and right border. Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted February 26, 2007 Share Posted February 26, 2007 Ok, thx for the tip.I think if you can see my forum its more easier to understand or to explain myself.http://forum.pt-sys.netIm trying to put an image with repeat-y in the left and right border.Sorry, but I can't find the part you have in your first post in the HTML code in that forum, so it's hard to help...But this is an example on how you could do it (as I can't find the right part of the HTML...)<table ...> <tr> <td style="height: 100%; background: url('<?php echo $settings['images_url']?>/left.gif') repeat-y;"> </td> </tr><tr> <td> <table..> /* Content table */ </table> </td> </tr><tr> <td style="height: 100%; background: url('<?php echo $settings['images_url']?>/right.gif') repeat-y;"> </td> </tr> Link to comment Share on other sites More sharing options...
pulpfiction Posted February 26, 2007 Share Posted February 26, 2007 Hi, im trying to repeat an image, but it only appears one time, at the top-left. I want join an image to the border of a table to make it a background.Oops... I did not see the echo'' in code you posted. Link to comment Share on other sites More sharing options...
Goodfella Posted February 26, 2007 Author Share Posted February 26, 2007 Ok, thx guys for the help.After dinner i will try to alter the code and i will feedback. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now