understanding php processing and page output order
Posted: Mon May 14, 2007 6:44 am
Hi All,
I have been using php for some time now and have got the hang of fairly high level processing including dynamic images from mysql output that leads me to the point of needing to better understand the processing /logic order of the php engine so i can increase the speed of my scripts.
so the Q i have is how is the following rendered by php,
template.php
require -> mysqldata.php to get info from db
require -> imagegd.php takes mysql data and var from template.php and resizes image then outputs to browser(no save)
Q1. a)does template.php have to wait for mysqldata.php to be fully rendered/computed before moving on to imagegd.php or
b)does imagegd.php get called immediately and has to wait for mysqldata.php to supply the info needed (i presume the (a) is correct)
Q2. once imagedgd.php has been called and an image generated is that image pushed to the browser or is the template.php rendered as html sent to browser and the browser then requests the imagegd.php script and the image is generated.
Q3. is there a good way ( i have tried ob_start("ob_gzhandler"); ) to buffer the page and wait for all images but it only seems to work on text/layout rather than graphics/fla etc.
thanks
Art
I have been using php for some time now and have got the hang of fairly high level processing including dynamic images from mysql output that leads me to the point of needing to better understand the processing /logic order of the php engine so i can increase the speed of my scripts.
so the Q i have is how is the following rendered by php,
template.php
require -> mysqldata.php to get info from db
require -> imagegd.php takes mysql data and var from template.php and resizes image then outputs to browser(no save)
Q1. a)does template.php have to wait for mysqldata.php to be fully rendered/computed before moving on to imagegd.php or
b)does imagegd.php get called immediately and has to wait for mysqldata.php to supply the info needed (i presume the (a) is correct)
Q2. once imagedgd.php has been called and an image generated is that image pushed to the browser or is the template.php rendered as html sent to browser and the browser then requests the imagegd.php script and the image is generated.
Q3. is there a good way ( i have tried ob_start("ob_gzhandler"); ) to buffer the page and wait for all images but it only seems to work on text/layout rather than graphics/fla etc.
thanks
Art