PHP passing parameters
===

I have two files [ Main.html ] and [image.php]. However [image.php] is dealing with binary data since it displays an image from the database. My question is can I and if i can how do I pass parameters into [image.php] from main?

I call image.php in main like this:  

> img src="image.php" alt="image retreived from DB"

 



    <?php
    $mysqli=mysqli_connect('localhost','root','','draftdb');
    if (!$mysqli)
    die("Can't connect to MySQL: ".mysqli_connect_error());
    
    
        $stmt = $mysqli->prepare("SELECT display.PICTURE_ID 
        FROM cards  
        INNER JOIN display ON cards.DISPLAY_ID = display.DISPLAY_ID 
        WHERE display.DISPLAY_ID=? AND cards.CARD_TYPE =?" );
         
         if( rand(1, 8) == 8) 
         {
         $cardtype='Mythic';
         $displayid=rand(1,15) ;
        
         }
         
         else
         {
         $cardtype='Rare';
        $displayid=rand(16,19) ;
         }
        
        $stmt->bind_param("si", $displayid, $cardtype);
        $stmt->execute();
        $stmt->bind_result($image);
        $stmt->fetch();
        header("Content-Type: image/jpeg");
        echo $image; 
        ?>
