you have very little knowledge of HTTP protocol.
Remove the last ?>
->You cannot print header after sending out html data.
->Your session should start ahead of including db.php
->you cannot send HTML data while you are sending image data. HTTP protocol did not stablish anything to achieve this.
->You have two distinct method POST or GET, using REQUEST is a bad idea.
to send image two methods can be used.
i) Convert the image into base64 encoded text and attach it with your html code. example(taken from wikipedia):
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />
look "base64_encode" up
ii) second method is simpler: save the string in a file as image. then create the image link with the path. Example:
<img src="<?=$path?>" >