jpoke5 Posted January 20, 2009 Share Posted January 20, 2009 hello, i have searched all over and cant seem to find any.... looking for info on how to replace the bg color code to a image background. this is the code i have for the background: $bgcolor = '000000'; How do i re format this for an image as background? i really suck at php Thanks... Jeff Quote Link to comment Share on other sites More sharing options...
BlueDevil23 Posted January 20, 2009 Share Posted January 20, 2009 Re: help with php image/color code hello, i have searched all over and cant seem to find any.... looking for info on how to replace the bg color code to a image background. this is the code i have for the background: $bgcolor = '000000'; How do i re format this for an image as background? i really suck at php Thanks... Jeff <style type="text/css"> body { background: url(imgurlhere); } </style> Place this in the <head> ... </head> Quote Link to comment Share on other sites More sharing options...
jpoke5 Posted January 20, 2009 Author Share Posted January 20, 2009 Re: help with php image/color code $u=$ir['username']; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; } $gn=""; global $staffpage; $bgcolor = '000000'; print <<<OUT [img=heroes2.jpg] <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> as you can see from my code that tag is located inside of other code so that will not work. This file is my header file for my torn city game. i really wanted to make the content and side panel box transparent so i could see the cool picture i used for my background. I assumed that was inpossible so wanted to change the bachground of the side panel and main menu to the same as my background but all the code i tryed did not work??? any advice? Thanks Jeff Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 20, 2009 Share Posted January 20, 2009 Re: help with php image/color code Setting the bg image isnt php its html or css. Bluedevil u didn't help much, seeing as he asked for a color not image. To do it simply just find the open <body> change it so something like this <body bgcolor="#000"> Quote Link to comment Share on other sites More sharing options...
jpoke5 Posted January 20, 2009 Author Share Posted January 20, 2009 Re: help with php image/color code No , I wanted to change the $bgcolor = '000000'; to something that shows an image but i dont know how to fromat the code to make it work. Posting the standard image tag (<body background="drkrainbow.gif">) returns an error: Parse error: syntax error, unexpected '<' in /home/mymicro/public_html/header.php on line 190 Im looking for a tag that follows that $ Jeff Quote Link to comment Share on other sites More sharing options...
shedh Posted January 20, 2009 Share Posted January 20, 2009 Re: help with php image/color code simple html aint it? in the css put body { background-image: url(/images/foo.gif) } obviously replacing /images/foo.gif to the url of your image Quote Link to comment Share on other sites More sharing options...
mdshare Posted January 20, 2009 Share Posted January 20, 2009 Re: help with php image/color code if you look at the pasted piece of source you will notice it's the bgcolor of a td <td width="20%" bgcolor="#$bgcolor" valign="top"> so to have it a background image instead of a color in the td <td bgimage="whatever.jpg"> Quote Link to comment Share on other sites More sharing options...
jpoke5 Posted January 20, 2009 Author Share Posted January 20, 2009 Re: help with php image/color code $gn=""; global $staffpage; $bgcolor = '000000'; print <<<OUT [img=heroes2.jpg] <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> nop that dont work, stupid shit...LOL Quote Link to comment Share on other sites More sharing options...
BlueDevil23 Posted January 20, 2009 Share Posted January 20, 2009 Re: help with php image/color code Setting the bg image isnt php its html or css. Bluedevil u didn't help much, seeing as he asked for a color not image. To do it simply just find the open <body> change it so something like this <body bgcolor="#000"> Read again... he asked for an image, but now that he posted more after the reply.... you can see he wants to change the background of a table data cell. Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted January 30, 2009 Share Posted January 30, 2009 Re: help with php image/color code I'm not sure what this guy wants, or if hes gonna get much help with remarks like "stupid shit".. Try changing <td width="20%" bgcolor="#$bgcolor" valign="top"> to <td width="20%" style = "background-image: url(".$bgcolor.");" valign="top"> then $bgcolor = '000000'; to $bgcolor = 'imagename.gif'; // or w/e this the image name and dir 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.