[PHP] #color problems

2002-11-15 Thread Adam
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 just using a
color value instead of variable).

The context is :: for formatting an XML doc.

$test='#FF';

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




Re: [PHP] #color problems

2002-11-15 Thread Marek Kilimajer
Do you mean it doesn't output the right html (which it should if you 
pasted it right, look at the html source)
or the browser doesn't display it (bgcolor in td is **deprecated, what 
doctype are you using?)

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 just using a
color value instead of variable).

The context is :: for formatting an XML doc.

$test='#FF';

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




Fw: [PHP] #color problems

2002-11-15 Thread Adam

Re: below, i put in

global $test;


 Thanks for the advice... I am new to PHP, but have done a lot of C in the
 past so some things are familiar.

 Anyway, I tried your suggestion but no joy... color does not show, as if i
 had written bgcolor=.

 Any ideas???

 Cheers,
 Adam.

 - Original Message -
 From: Marco Tabini [EMAIL PROTECTED]
 To: Adam [EMAIL PROTECTED]
 Sent: Friday, November 15, 2002 2:47 PM
 Subject: Re: [PHP] #color problems


  Since you're not substituting anything in your string, you can use
  single quotes and make it a bit more readable:
 
  $test='#FF';
 
  echo 'td width=33% bgcolor=' . $test . '';
 
 
  is $test defined in the same context as your echo statement (e.g. is the
  echo in a function and $test outside of it)? In that case, you need to
  add $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 just
using
 a
   color value instead of variable).
  
   The context is :: for formatting an XML doc.
  
   $test='#FF';
  
   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
  
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Fw: [PHP] #color problems

2002-11-15 Thread Marco Tabini
Does 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 the
  past so some things are familiar.
 
  Anyway, I tried your suggestion but no joy... color does not show, as if i
  had written bgcolor=.
 
  Any ideas???
 
  Cheers,
  Adam.
 
  - Original Message -
  From: Marco Tabini [EMAIL PROTECTED]
  To: Adam [EMAIL PROTECTED]
  Sent: Friday, November 15, 2002 2:47 PM
  Subject: Re: [PHP] #color problems
 
 
   Since you're not substituting anything in your string, you can use
   single quotes and make it a bit more readable:
  
   $test='#FF';
  
   echo 'td width=33% bgcolor=' . $test . '';
  
  
   is $test defined in the same context as your echo statement (e.g. is the
   echo in a function and $test outside of it)? In that case, you need to
   add $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 just
 using
  a
color value instead of variable).
   
The context is :: for formatting an XML doc.
   
$test='#FF';
   
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
   
  
  
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Fw: [PHP] #color problems

2002-11-15 Thread Adam
OK, color code is not present in HTML output. Very strange!
echo $test; produces hte correct output though.

Adam.

- Original Message -
From: Marco Tabini [EMAIL PROTECTED]
To: Adam [EMAIL PROTECTED]
Cc: PHP [EMAIL PROTECTED]
Sent: Friday, November 15, 2002 3:14 PM
Subject: Re: Fw: [PHP] #color problems


 Does 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
the
   past so some things are familiar.
  
   Anyway, I tried your suggestion but no joy... color does not show, as
if i
   had written bgcolor=.
  
   Any ideas???
  
   Cheers,
   Adam.
  
   - Original Message -
   From: Marco Tabini [EMAIL PROTECTED]
   To: Adam [EMAIL PROTECTED]
   Sent: Friday, November 15, 2002 2:47 PM
   Subject: Re: [PHP] #color problems
  
  
Since you're not substituting anything in your string, you can use
single quotes and make it a bit more readable:
   
$test='#FF';
   
echo 'td width=33% bgcolor=' . $test . '';
   
   
is $test defined in the same context as your echo statement (e.g. is
the
echo in a function and $test outside of it)? In that case, you need
to
add $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 just
  using
   a
 color value instead of variable).

 The context is :: for formatting an XML doc.

 $test='#FF';

 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

   
   
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Fw: [PHP] #color problems

2002-11-15 Thread Marek Kilimajer
I you did put
echo $test;
right before echo 'td width=33% bgcolor=' . $test . '';
COPYPASTE 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 [EMAIL PROTECTED]
To: Adam [EMAIL PROTECTED]
Cc: PHP [EMAIL PROTECTED]
Sent: Friday, November 15, 2002 3:14 PM
Subject: Re: Fw: [PHP] #color problems


 

Does 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
   

the
 

past so some things are familiar.

Anyway, I tried your suggestion but no joy... color does not show, as
   

if i
 

had written bgcolor=.

Any ideas???

Cheers,
Adam.

- Original Message -
From: Marco Tabini [EMAIL PROTECTED]
To: Adam [EMAIL PROTECTED]
Sent: Friday, November 15, 2002 2:47 PM
Subject: Re: [PHP] #color problems


   

Since you're not substituting anything in your string, you can use
single quotes and make it a bit more readable:

$test='#FF';

echo 'td width=33% bgcolor=' . $test . '';


is $test defined in the same context as your echo statement (e.g. is
 

the
 

echo in a function and $test outside of it)? In that case, you need
 

to
 

add $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 just
   

using
 

a
   

color value instead of variable).

The context is :: for formatting an XML doc.

$test='#FF';

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

   

 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 

   



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Fw: [PHP] #color problems

2002-11-15 Thread @ Edwin
Hello,

Adam [EMAIL PROTECTED] wrote:

 OK, color code is not present in HTML output. Very strange!

What do you exactly mean by color code is not present in HTML output?

...[snip]...

Also,

Anyway, I tried your suggestion but no joy... color does not show,
as
if i had written bgcolor=.

What did you mean by color does not show? A white color will not show on a
white background ;)

- E

...[snip]...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] color problems when resizing image with GD

2001-11-29 Thread Michael Hall

We run on a Windows platform.  If a client uploads an image to my script
that is too wide, I want to use GD to resize the image down to the proper
dimensions.

The problem I'm having is that the resized image drops huge chunks of the
color pallette, creating what is basically a monochromatic image.

Is there any way around this?  Am I doing something wrong?  I'm not very
familiar at all with the graphics part of things, so I'm hoping there's
something glarinly obvious that I'm missing.

The code follows.

$src_img =
ImageCreateFromJpeg(../images/property/property_.$id.tmp.jpg);

#[...]

$dst_img = ImageCreate ($new_w,$new_h);


ImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img)
,ImageSY($src_img));

ImageJpeg($dst_img,../images/property/property_.$id..jpeg);



Michael Hall
Web Development Manager / Sr. Programmer
Prairie Fire Internet Technologies
[EMAIL PROTECTED]
605.357.9700 ext. 14


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]