Re: [PHP] Graphics question

2002-11-08 Thread Ernest E Vogelsinger
At 05:38 08.11.2002, Mike Mannakee said:
[snip]
Jeez, this is simple.  The browser is caching the image.  There's no real
way to fix that.  There are some headers that may encourage the browser to
not cache, but there is no sure way to control whether the users will have
this setting overridden.

Or, as in a previous thread from yesterday, you could make the image url
look different by using random():

img src=http://your/imageurl.jpg??php echo random()?

You can also search for specifics of the headers that are meant to stop a
browser from caching.

No-cache MIME headers are:
header('Pragma: no-cache');
header('Cache: none');


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] Graphics question

2002-11-07 Thread Robbert van Andel
I have created a webpage that builds a table and graph using the GD
functions.  When I switch to another page or select a different month to
build the table for, the graph.jpg does not rebuild.  I have to press
reload to make the graph render using the new data.  I have used
imagedistroy($pic) in the hopes that this will work, but it didn't.

To elaborate on the situation, I first call imagecreate, then run the
code to create the bar graph.  I then use

imagejpg($pic,$graphname) (or something ot that affect.  I don't have
access to the code at home).

I then show the picture using 

echo img src=\$graph\;

Finally I call imagedestroy($pic).   Do you have any suggestions?




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




RE: [PHP] Graphics question

2002-11-07 Thread Martin Towell
sounds like a browser caching problem to me
dunno if that helps though :/

-Original Message-
From: Robbert van Andel [mailto:robbert;vafam.com]
Sent: Friday, November 08, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Graphics question


I have created a webpage that builds a table and graph using the GD
functions.  When I switch to another page or select a different month to
build the table for, the graph.jpg does not rebuild.  I have to press
reload to make the graph render using the new data.  I have used
imagedistroy($pic) in the hopes that this will work, but it didn't.

To elaborate on the situation, I first call imagecreate, then run the
code to create the bar graph.  I then use

imagejpg($pic,$graphname) (or something ot that affect.  I don't have
access to the code at home).

I then show the picture using 

echo img src=\$graph\;

Finally I call imagedestroy($pic).   Do you have any suggestions?




-- 
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: [PHP] Graphics question

2002-11-07 Thread Robbert van Andel
Is there a way I can keep the caching from happening using PHP?

On Thu, 2002-11-07 at 19:32, Martin Towell wrote:
 sounds like a browser caching problem to me
 dunno if that helps though :/
 
 -Original Message-
 From: Robbert van Andel [mailto:robbert;vafam.com]
 Sent: Friday, November 08, 2002 2:30 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Graphics question
 
 
 I have created a webpage that builds a table and graph using the GD
 functions.  When I switch to another page or select a different month to
 build the table for, the graph.jpg does not rebuild.  I have to press
 reload to make the graph render using the new data.  I have used
 imagedistroy($pic) in the hopes that this will work, but it didn't.
 
 To elaborate on the situation, I first call imagecreate, then run the
 code to create the bar graph.  I then use
 
 imagejpg($pic,$graphname) (or something ot that affect.  I don't have
 access to the code at home).
 
 I then show the picture using 
 
 echo img src=\$graph\;
 
 Finally I call imagedestroy($pic).   Do you have any suggestions?
 
 
 
 
 -- 
 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: [PHP] Graphics question

2002-11-07 Thread Marco Tabini
It's explained in the header() page of the manual:

?php
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
 // always modified
header(Cache-Control: no-store, no-cache, must-revalidate);  //
HTTP/1.1
header(Cache-Control: post-check=0, pre-check=0, false);
header(Pragma: no-cache);  // HTTP/1.0
?


Marco

-
php|architect -- The Monthly Magazine For PHP Professionals
Come visit us on the web at http://www.phparch.com!


On Thu, 2002-11-07 at 22:35, Robbert van Andel wrote:
 Is there a way I can keep the caching from happening using PHP?
 
 On Thu, 2002-11-07 at 19:32, Martin Towell wrote:
  sounds like a browser caching problem to me
  dunno if that helps though :/
  
  -Original Message-
  From: Robbert van Andel [mailto:robbert;vafam.com]
  Sent: Friday, November 08, 2002 2:30 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Graphics question
  
  
  I have created a webpage that builds a table and graph using the GD
  functions.  When I switch to another page or select a different month to
  build the table for, the graph.jpg does not rebuild.  I have to press
  reload to make the graph render using the new data.  I have used
  imagedistroy($pic) in the hopes that this will work, but it didn't.
  
  To elaborate on the situation, I first call imagecreate, then run the
  code to create the bar graph.  I then use
  
  imagejpg($pic,$graphname) (or something ot that affect.  I don't have
  access to the code at home).
  
  I then show the picture using 
  
  echo img src=\$graph\;
  
  Finally I call imagedestroy($pic).   Do you have any suggestions?
  
  
  
  
  -- 
  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: [PHP] Graphics question

2002-11-07 Thread @ Darwin
The reason imagedestroy() may have not worked for you is that maybe
imagedestroy() is misspelled? If you misspelled it in the code then it won't
work. Just a suggestion.

- Darwin

 -Original Message-
 From: Robbert van Andel [mailto:robbert;vafam.com]
 Sent: Thursday, November 07, 2002 9:30 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Graphics question


 I have created a webpage that builds a table and graph using the GD
 functions.  When I switch to another page or select a different month to
 build the table for, the graph.jpg does not rebuild.  I have to press
 reload to make the graph render using the new data.  I have used
 imagedistroy($pic) in the hopes that this will work, but it didn't.

 To elaborate on the situation, I first call imagecreate, then run the
 code to create the bar graph.  I then use

 imagejpg($pic,$graphname) (or something ot that affect.  I don't have
 access to the code at home).

 I then show the picture using

 echo img src=\$graph\;

 Finally I call imagedestroy($pic).   Do you have any suggestions?




 --
 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: [PHP] Graphics question

2002-11-07 Thread Robbert van Andel
That would cause an error like call to undefined function.  But thanks
for the suggestion.

On Thu, 2002-11-07 at 20:04, @ Darwin wrote:
 The reason imagedestroy() may have not worked for you is that maybe
 imagedestroy() is misspelled? If you misspelled it in the code then it won't
 work. Just a suggestion.
 
 - Darwin
 
  -Original Message-
  From: Robbert van Andel [mailto:robbert;vafam.com]
  Sent: Thursday, November 07, 2002 9:30 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Graphics question
 
 
  I have created a webpage that builds a table and graph using the GD
  functions.  When I switch to another page or select a different month to
  build the table for, the graph.jpg does not rebuild.  I have to press
  reload to make the graph render using the new data.  I have used
  imagedistroy($pic) in the hopes that this will work, but it didn't.
 
  To elaborate on the situation, I first call imagecreate, then run the
  code to create the bar graph.  I then use
 
  imagejpg($pic,$graphname) (or something ot that affect.  I don't have
  access to the code at home).
 
  I then show the picture using
 
  echo img src=\$graph\;
 
  Finally I call imagedestroy($pic).   Do you have any suggestions?
 
 
 
 
  --
  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: [PHP] Graphics question

2002-11-07 Thread Brendon G
If it's just the browser caching are you able to use something like
graph.jpg?cachebust=something random here like a datetime or something.

I'm not familiar with the way your doing it.. but I guess it has to be given
a name to the browser somewhere doesn't it?

I use this on pages and images as well as headers for things that must not
be cached.

Cheers

Brendon

-Original Message-
From: Mike Mannakee [mailto:mike;basementideas.com]
Sent: Friday, November 08, 2002 2:39 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Graphics question


Jeez, this is simple.  The browser is caching the image.  There's no real
way to fix that.  There are some headers that may encourage the browser to
not cache, but there is no sure way to control whether the users will have
this setting overridden.

imagedestroy($pic); is only freeing the memory used on the server while the
script is executing.  It's nice if you're doing a whole bunch of processing
after generating the image but otherwise the memory is automatically freed
when the script exits.  It will do nothing to affect the copy that now sits
in the browser's cache.

In other words, you'll just have to hit reload.

You can also search for specifics of the headers that are meant to stop a
browser from caching.

Mike


@ Darwin [EMAIL PROTECTED] wrote in message
news:ELEJIJLJOIJKFAHADGOMGEBHCBAA.superbus22;attbi.com...
 The reason imagedestroy() may have not worked for you is that maybe
 imagedestroy() is misspelled? If you misspelled it in the code then it
won't
 work. Just a suggestion.

 - Darwin

  -Original Message-
  From: Robbert van Andel [mailto:robbert;vafam.com]
  Sent: Thursday, November 07, 2002 9:30 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Graphics question
 
 
  I have created a webpage that builds a table and graph using the GD
  functions.  When I switch to another page or select a different month to
  build the table for, the graph.jpg does not rebuild.  I have to press
  reload to make the graph render using the new data.  I have used
  imagedistroy($pic) in the hopes that this will work, but it didn't.
 
  To elaborate on the situation, I first call imagecreate, then run the
  code to create the bar graph.  I then use
 
  imagejpg($pic,$graphname) (or something ot that affect.  I don't have
  access to the code at home).
 
  I then show the picture using
 
  echo img src=\$graph\;
 
  Finally I call imagedestroy($pic).   Do you have any suggestions?
 
 
 
 
  --
  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: [PHP] Graphics question

2002-11-07 Thread Todd Pasley
 Jeez, this is simple.  The browser is caching the image.  There's no real
 way to fix that.  There are some headers that may encourage the browser to
 not cache, but there is no sure way to control whether the users will have
 this setting overridden.


I use

 srand((double)microtime()*100);
 $anticache= md5(rand(0,999));

and then


echo IMG
src=\drawpic.php?arg1=blaharg2=blah.anticache=$anticache\ 
\n;

Since this addition, i have never had a problem with cache,

HTH

Todd.


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