Re: Fw: [PHP] #color problems
| From: | Marek Kilimajer | Date: | Fri, 15 Nov 2002 15:57:38 +0000 |
| Subject: | Re: Fw: [PHP] #color problems | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124618@lists.php.net to get a copy of this message | ||
I you did put
echo $test;
right before echo '<td width="33%" bgcolor="' . $test . '">';
COPY&PASTE your code (don't write it from memory!) and show us
Adam wrote:
OK, color code is not present in HTML output. Very strange! "echo $test;" produces hte correct output though. Adam. ----- Original Message ----- From: "Marco Tabini" <marcot@tabini.ca> To: "Adam" <adam@runtime-records.com> Cc: ""PHP"" <php-general@lists.php.net> Sent: Friday, November 15, 2002 3:14 PM Subject: Re: Fw: [PHP] #color problemstheDoes your color code show in the HTML source code? If so, then it's an HTML problem! Marco On Fri, 2002-11-15 at 10:46, Adam wrote:Re: below, i put in global $test;Thanks for the advice... I am new to PHP, but have done a lot of C in
if ipast so some things are familiar. Anyway, I tried your suggestion but no joy... color does not show, as
thehad written bgcolor="". Any ideas??? Cheers, Adam. ----- Original Message ----- From: "Marco Tabini" <marcot@tabini.ca> To: "Adam" <adam@runtime-records.com> Sent: Friday, November 15, 2002 2:47 PM Subject: Re: [PHP] #color problemsSince you're not substituting anything in your string, you can use single quotes and make it a bit more readable: $test='#FFFFFF'; echo '<td width="33%" bgcolor="' . $test . '">'; is $test defined in the same context as your echo statement (e.g. is
toecho in a function and $test outside of it)? In that case, you need
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpusingadd $test to your function's context by means of global $test; Marco -- ------------ php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! On Fri, 2002-11-15 at 10:13, Adam wrote:Below is a snip of my script. Can't get it to use $test as a color variable!! Can anyone help?? I have tried everything i can think of (bar justacolor value instead of variable). The context is :: for formatting an XML doc. $test='#FFFFFF'; echo "<td width=\"33%\" bgcolor=\"".$test."\">"; Any help much appreciated, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php