Jump to content
MakeWebGames

help with php image/color code


jpoke5

Recommended Posts

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...