Page 1 of 1

Sending pics by header function acting funny

Posted: Thu Jun 16, 2005 2:33 pm
by pthomas
First some code:

Code: Select all

<?php
	clear_all();	
	Set_Text( "Print this stuff" );
	Set_Font_Type( "Vera" );
	Set_Font_Size( 12 );
	Set_Font_Angle( 15 );
	Set_Padding( 15, 18);
	Set_Text_RGB( 10, 55, 10 );
	Set_BG_RGB( 250, 250, 250 );
	echo '<IMG SRC="image_generator.php"/>'."\n";
	echo "<BR/>" . print_r($_SESSION);
	
	clear_all();
	Set_Text( "the 2nd test" );
	Set_Font_Type( "Vera" );
	Set_Font_Size( 20 );
	Set_Padding( 15, 10);
	Set_Text_RGB( 55, 75, 75 );
	Set_BG_RGB( 250, 250, 250 );
	echo '<IMG SRC="image_generator.php"/>'."\n";
	echo "<BR/>" . print_r($_SESSION);
?>
I'm taking and setting all needed variables to create the first picture and by the text from the print_r command, the variables are getting set correctly. The problem I have is when I call
echo '<IMG SRC="image_generator.php"/>'."\n";
it always displays the last picture. If i comment out all the code for the second one (13-21), the 1st pic shows up like it should. But if I have both uncommented like the above code, the 2nd picture is shown twice in the place of itself AND where the first one should be.

Is the browser caching this "image" since the name is exactly the same even though they end up being two totally different images?

Thanks,
Paul

Posted: Thu Jun 16, 2005 10:18 pm
by feyd
basically, yes. Use a random text generation as a query string in the url to create unique references and such.