Re: [PHP] Re: if statement and imageline()

2001-08-30 Thread Hugh Danaher

Richard, I let this problem sit for awhile, did some other work, and looked
at it again.  This time, I printed out all the values and found that some
values =INF.  No wonder it died.  Since I'm making a log-normal chart,
occasionally I'm trying to calculate the log of zero--an infinitely small
number which can't be calculated!  I did try the error_log statement but my
ISP puked on the syntax.
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: Hugh Danaher [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 1:21 PM
Subject: Re: [PHP] Re: if statement and imageline()


 No.  150 lines is chump change.

 See if you can get ImageLine to work in a simpler fashion.

 Also, try adding:

 error_log(ImageLine: $start_x $start_y $x $y, E_NOTICE);

 And then look at your Apache logs.

 You'll at least be able to see if the program is getting there while it
 tries to draw stuff.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 To: Richard Lynch [EMAIL PROTECTED]
 Cc: Php-General [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 3:50 AM
 Subject: Re: [PHP] Re: if statement and imageline()


  Richard,
  No, the code was cut from the php file and displayed as is in my e-mail.
 I
  also tried to see if I could declare the two suspect variables in
another
  IF() statement before the IF() statement that's fouling the execution of
 the
  .jpg construct, but no luck there too.  Could I just be overburdening
the
  program?  I've got a lot of code (about 150 lines) in the .jpg
construct.
  Cheers,
  Hugh
  - Original Message -
  From: Richard Lynch [EMAIL PROTECTED]
  To: Hugh Danaher [EMAIL PROTECTED]
  Sent: Wednesday, August 22, 2001 12:18 AM
  Subject: Re: [PHP] Re: if statement and imageline()
 
 
   Hmm.
  
   Are you sure you didn't have:
  
   if ($year = $startyear)
  
   *THAT* would assign 1996 over and over to $year, after the ++, so it
 would
   never move forward, and the script would time out...
  
   Not sure what else could be wrong, if it's *JUST* the if part you are
   adding...
  
   --
   WARNING [EMAIL PROTECTED] address is an endangered species -- Use
   [EMAIL PROTECTED]
   Wanna help me out?  Like Music?  Buy a CD:
http://l-i-e.com/artists.htm
   Volunteer a little time: http://chatmusic.com/volunteer.htm
   - Original Message -
   From: Hugh Danaher [EMAIL PROTECTED]
   To: Richard Lynch [EMAIL PROTECTED]
   Cc: Php-General [EMAIL PROTECTED]
   Sent: Wednesday, August 22, 2001 1:05 AM
   Subject: Re: [PHP] Re: if statement and imageline()
  
  
Richard,
   
Without the code below, I get a good .jpg file and it displays
nicely.
   But,
with the IF statement in, I get a time out error message Execute
time
exceeds 30 seconds...  I think it is because two of the variables
are
declared after the IF statement, even though they aren't being used
on
  the
first loop.  I'll try to declare them before the FOR loop and see if
  that
works.
   
As you might tell from my code, the only software course I ever had,
 was
   in
college 20 years ago, and it was in BASIC language (with line
 numbers!).
However, I find php easy to work with, and have done some amazing
 things
with it in the last 2 months.  With your help and the help of
others,
  I'll
certainly make progress.
   
Thanks,
Hugh
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 21, 2001 5:16 PM
Subject: [PHP] Re: if statement and imageline()
   
   
 What are you getting?  An image at all?  Broken image?

 Try getting rid of the header(image/jpeg) or whatever, and see
if
  you
have
 some error message.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD:
  http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 Newsgroups: php.general
 To: Php-General [EMAIL PROTECTED]
 Sent: Tuesday, August 21, 2001 1:16 AM
 Subject: if statement and imageline()


 help,

 I am trying to set up a .jpg file to graph the earnings per year
of
 a
 company.  I can generate a log-normal graph, can get it to display
 the
 earnings per year as circles on the graph, but I can't get the  
if
  ()
   
 statement to work.  I know I am setting two of the variables in
the
 if
 statement after the if statement executes once, but these
variables
   won't
be
 used until after the  for ()  loops once, and therefore should
be
 available for use in  imageline()  on the second loop

Re: [PHP] Re: if statement and imageline()

2001-08-22 Thread Hugh Danaher

Richard,
No, the code was cut from the php file and displayed as is in my e-mail.  I
also tried to see if I could declare the two suspect variables in another
IF() statement before the IF() statement that's fouling the execution of the
.jpg construct, but no luck there too.  Could I just be overburdening the
program?  I've got a lot of code (about 150 lines) in the .jpg construct.
Cheers,
Hugh
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: Hugh Danaher [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 12:18 AM
Subject: Re: [PHP] Re: if statement and imageline()


 Hmm.

 Are you sure you didn't have:

 if ($year = $startyear)

 *THAT* would assign 1996 over and over to $year, after the ++, so it would
 never move forward, and the script would time out...

 Not sure what else could be wrong, if it's *JUST* the if part you are
 adding...

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 To: Richard Lynch [EMAIL PROTECTED]
 Cc: Php-General [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 1:05 AM
 Subject: Re: [PHP] Re: if statement and imageline()


  Richard,
 
  Without the code below, I get a good .jpg file and it displays nicely.
 But,
  with the IF statement in, I get a time out error message Execute time
  exceeds 30 seconds...  I think it is because two of the variables are
  declared after the IF statement, even though they aren't being used on
the
  first loop.  I'll try to declare them before the FOR loop and see if
that
  works.
 
  As you might tell from my code, the only software course I ever had, was
 in
  college 20 years ago, and it was in BASIC language (with line numbers!).
  However, I find php easy to work with, and have done some amazing things
  with it in the last 2 months.  With your help and the help of others,
I'll
  certainly make progress.
 
  Thanks,
  Hugh
  - Original Message -
  From: Richard Lynch [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, August 21, 2001 5:16 PM
  Subject: [PHP] Re: if statement and imageline()
 
 
   What are you getting?  An image at all?  Broken image?
  
   Try getting rid of the header(image/jpeg) or whatever, and see if
you
  have
   some error message.
  
   --
   WARNING [EMAIL PROTECTED] address is an endangered species -- Use
   [EMAIL PROTECTED]
   Wanna help me out?  Like Music?  Buy a CD:
http://l-i-e.com/artists.htm
   Volunteer a little time: http://chatmusic.com/volunteer.htm
   - Original Message -
   From: Hugh Danaher [EMAIL PROTECTED]
   Newsgroups: php.general
   To: Php-General [EMAIL PROTECTED]
   Sent: Tuesday, August 21, 2001 1:16 AM
   Subject: if statement and imageline()
  
  
   help,
  
   I am trying to set up a .jpg file to graph the earnings per year of a
   company.  I can generate a log-normal graph, can get it to display the
   earnings per year as circles on the graph, but I can't get the   if
()
 
   statement to work.  I know I am setting two of the variables in the if
   statement after the if statement executes once, but these variables
 won't
  be
   used until after the  for ()  loops once, and therefore should be
   available for use in  imageline()  on the second loop (where
   $year$startyear).  Somehow, I think my logic is correct but it
mustn't
 be
   so.
  
  
   $startyear=1996;
   $chart_start_year=1992;
   for ($year=$startyear;$year=$startyear+7;$year++)
{
$x=(($year-$chart_start_year)*20)+20;
$y=420-log(${earnings_.$year})*75;
if ($year$startyear)
 {
 imageline($image,$first_x,$first_y,$x,$y,$blue);
 }
$first_x=$x;
$first_y=$y;
  
  imagettftext($image,9,0,$x_distance-4,$y_distance+3,$blue,$font2,m);
}
  
  
  
   --
   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]
  



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




Re: [PHP] Re: if statement and imageline()

2001-08-22 Thread Hugh Danaher

Richard,
Thanks for your help.  I'll try the error_log() and see what comes out.
Hugh
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: Hugh Danaher [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 1:21 PM
Subject: Re: [PHP] Re: if statement and imageline()


 No.  150 lines is chump change.

 See if you can get ImageLine to work in a simpler fashion.

 Also, try adding:

 error_log(ImageLine: $start_x $start_y $x $y, E_NOTICE);

 And then look at your Apache logs.

 You'll at least be able to see if the program is getting there while it
 tries to draw stuff.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 To: Richard Lynch [EMAIL PROTECTED]
 Cc: Php-General [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 3:50 AM
 Subject: Re: [PHP] Re: if statement and imageline()


  Richard,
  No, the code was cut from the php file and displayed as is in my e-mail.
 I
  also tried to see if I could declare the two suspect variables in
another
  IF() statement before the IF() statement that's fouling the execution of
 the
  .jpg construct, but no luck there too.  Could I just be overburdening
the
  program?  I've got a lot of code (about 150 lines) in the .jpg
construct.
  Cheers,
  Hugh
  - Original Message -
  From: Richard Lynch [EMAIL PROTECTED]
  To: Hugh Danaher [EMAIL PROTECTED]
  Sent: Wednesday, August 22, 2001 12:18 AM
  Subject: Re: [PHP] Re: if statement and imageline()
 
 
   Hmm.
  
   Are you sure you didn't have:
  
   if ($year = $startyear)
  
   *THAT* would assign 1996 over and over to $year, after the ++, so it
 would
   never move forward, and the script would time out...
  
   Not sure what else could be wrong, if it's *JUST* the if part you are
   adding...
  
   --
   WARNING [EMAIL PROTECTED] address is an endangered species -- Use
   [EMAIL PROTECTED]
   Wanna help me out?  Like Music?  Buy a CD:
http://l-i-e.com/artists.htm
   Volunteer a little time: http://chatmusic.com/volunteer.htm
   - Original Message -
   From: Hugh Danaher [EMAIL PROTECTED]
   To: Richard Lynch [EMAIL PROTECTED]
   Cc: Php-General [EMAIL PROTECTED]
   Sent: Wednesday, August 22, 2001 1:05 AM
   Subject: Re: [PHP] Re: if statement and imageline()
  
  
Richard,
   
Without the code below, I get a good .jpg file and it displays
nicely.
   But,
with the IF statement in, I get a time out error message Execute
time
exceeds 30 seconds...  I think it is because two of the variables
are
declared after the IF statement, even though they aren't being used
on
  the
first loop.  I'll try to declare them before the FOR loop and see if
  that
works.
   
As you might tell from my code, the only software course I ever had,
 was
   in
college 20 years ago, and it was in BASIC language (with line
 numbers!).
However, I find php easy to work with, and have done some amazing
 things
with it in the last 2 months.  With your help and the help of
others,
  I'll
certainly make progress.
   
Thanks,
Hugh
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 21, 2001 5:16 PM
Subject: [PHP] Re: if statement and imageline()
   
   
 What are you getting?  An image at all?  Broken image?

 Try getting rid of the header(image/jpeg) or whatever, and see
if
  you
have
 some error message.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD:
  http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 Newsgroups: php.general
 To: Php-General [EMAIL PROTECTED]
 Sent: Tuesday, August 21, 2001 1:16 AM
 Subject: if statement and imageline()


 help,

 I am trying to set up a .jpg file to graph the earnings per year
of
 a
 company.  I can generate a log-normal graph, can get it to display
 the
 earnings per year as circles on the graph, but I can't get the  
if
  ()
   
 statement to work.  I know I am setting two of the variables in
the
 if
 statement after the if statement executes once, but these
variables
   won't
be
 used until after the  for ()  loops once, and therefore should
be
 available for use in  imageline()  on the second loop (where
 $year$startyear).  Somehow, I think my logic is correct but it
  mustn't
   be
 so.


 $startyear=1996;
 $chart_start_year=1992;
 for ($year=$startyear;$year=$startyear+7;$year++)
  {
  $x=(($year-$chart_start_year)*20)+20;
  $y=420-log(${earnings_

Re: [PHP] Re: if statement and imageline()

2001-08-21 Thread Hugh Danaher

Richard,

Without the code below, I get a good .jpg file and it displays nicely.  But,
with the IF statement in, I get a time out error message Execute time
exceeds 30 seconds...  I think it is because two of the variables are
declared after the IF statement, even though they aren't being used on the
first loop.  I'll try to declare them before the FOR loop and see if that
works.

As you might tell from my code, the only software course I ever had, was in
college 20 years ago, and it was in BASIC language (with line numbers!).
However, I find php easy to work with, and have done some amazing things
with it in the last 2 months.  With your help and the help of others, I'll
certainly make progress.

Thanks,
Hugh
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 21, 2001 5:16 PM
Subject: [PHP] Re: if statement and imageline()


 What are you getting?  An image at all?  Broken image?

 Try getting rid of the header(image/jpeg) or whatever, and see if you
have
 some error message.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 Newsgroups: php.general
 To: Php-General [EMAIL PROTECTED]
 Sent: Tuesday, August 21, 2001 1:16 AM
 Subject: if statement and imageline()


 help,

 I am trying to set up a .jpg file to graph the earnings per year of a
 company.  I can generate a log-normal graph, can get it to display the
 earnings per year as circles on the graph, but I can't get the   if () 
 statement to work.  I know I am setting two of the variables in the if
 statement after the if statement executes once, but these variables won't
be
 used until after the  for ()  loops once, and therefore should be
 available for use in  imageline()  on the second loop (where
 $year$startyear).  Somehow, I think my logic is correct but it mustn't be
 so.


 $startyear=1996;
 $chart_start_year=1992;
 for ($year=$startyear;$year=$startyear+7;$year++)
  {
  $x=(($year-$chart_start_year)*20)+20;
  $y=420-log(${earnings_.$year})*75;
  if ($year$startyear)
   {
   imageline($image,$first_x,$first_y,$x,$y,$blue);
   }
  $first_x=$x;
  $first_y=$y;

imagettftext($image,9,0,$x_distance-4,$y_distance+3,$blue,$font2,m);
  }



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



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