QRCode generator how to print to the form from database

I appreciate any help i can get on this, i’ve been trying to get info from my data base to be printed to the form in the qr code generator, however been very un successful can anyone give any advice on where i’m going wrong… thanks…

<?php     
/*
 * PHP QR Code encoder
 *
 * Exemplatory usage
 *
 * PHP QR Code is distributed under LGPL 3
 * Copyright (C) 2010 Dominik Dzienia <deltalab at poczta dot fm>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
    
    echo "<h1>Customer order information</h1><hr/>";
    
    //set it to writable location, a place for temp generated PNG files
	
    $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
    
    //html PNG location prefix
    $PNG_WEB_DIR = 'temp/';

    include "qrlib.php";    
	
	//new codes added
	
	
//`products_weight``products_weight`SELECT * FROM `products` WHERE 1


// Start_session, check if user is logged in or not, and connect to the database all in one included file
//if($_POST['orders_id']!="");
  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');

// ------- INITIALIZE SOME VARIABLES ---------
// they must be initialized in some server environments or else errors will get thrown

$orders_id = "";
$customer_name = "";
$customer_street_address = "";

// ------- END INITIALIZE SOME VARIABLES ---------

// ------- ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS ---------
if (isset($_GET['orders_id, customer_name, customer_street_address'])) {
	 $orders_id = preg_replace('#[^0-9]#i', '', $_GET['orders_id']);}
	  // filter everything but numbers
 
 else if (isset($_SESSION['id'])) {
	 $orders_id = $orders_id;
} else {
   header("location: index.php");
   exit();
}

// ------- END ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS ---------
// ------- FILTER THE ID AND QUERY THE DATABASE --------

$orders_id = preg_replace('#[^0-9]#i', '', $orders_id); 

// filter everything but numbers on the ID just in case

$sql = mysql_query("SELECT * FROM orders WHERE id='$orders_id' LIMIT 1");

 // query the member
// ------- FILTER THE ID AND QUERY THE DATABASE --------

// ------- MAKE SURE PERSON EXISTS IN DATABASE ---------

$existCount = mysql_num_rows($sql);

 // count the row nums

 if ($existCount == 0) {
	 
	  // evaluate the count
	 
	 header("location: index.php?msg=user_does_not_exist");
     exit();
}
// ------- END MAKE SURE PERSON EXISTS IN DATABASE ---------

// ------- WHILE LOOP FOR GETTING THE MEMBER DATA ---------

while($row = mysql_fetch_array($sql)){ 
    $orders_id = $row["orders_id"];
	$customer_name = $row["customer_name"];
	$customer_street_address = $row["customer_street_address"];


 // close while loop
// ------- END WHILE LOOP FOR GETTING THE MEMBER DATA ---------
    //end new codes added
	
    //ofcourse we need rights to create temp dir

    if (!file_exists($PNG_TEMP_DIR))
        mkdir($PNG_TEMP_DIR);
        
    $filename = $PNG_TEMP_DIR.'test.png';
    
    //processing form input
    //remember to sanitize user input in real-life solution !!!
    $errorCorrectionLevel = 'H';
    if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H')))
        $errorCorrectionLevel = $_REQUEST['level'];    

    $matrixPointSize = 10;
    if (isset($_REQUEST['size']))
        $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10);


    if (isset($_REQUEST['data'])) { 
    
        //it's very important!
		
        if (trim($_REQUEST['data']) == '')
            die('data cannot be empty! <a href="?">back</a>');
            
        // user data
		
        $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
        QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2);    
        
    } else {    
    
        //default data
      
	    echo 'You can provide data in GET parameter: <a href="?data=like_that">like that</a><hr/>';    
        QRcode::png('PHP QR Code :)', $filename, $errorCorrectionLevel, $matrixPointSize, 2);    
        
    }    
        
    //display generated file
   
    echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" /><hr/>';  
    
    //config form
	
    echo '<form action="index.php" enctype="multipart/form-data" method="post">
        Data: <input name="data" value="'.(isset($_REQUEST['data'])?htmlspecialchars($_REQUEST['data']):'<?php print "$customer_name, $customer_street_address, $orders_id"; ?)').'" /> 
        ECC: <select name="level">
            <option value="L"'.(($errorCorrectionLevel=='L')?' selected':'').'>L - smallest</option>
            <option value="M"'.(($errorCorrectionLevel=='M')?' selected':'').'>M</option>
            <option value="Q"'.(($errorCorrectionLevel=='Q')?' selected':'').'>Q</option>
            <option value="H"'.(($errorCorrectionLevel=='H')?' selected':'').'>H - best</option>
        </select> 
        Size: <select name="size">';
        
		
    for($i=1;$i<=10;$i++)
        echo '<option value="'.$i.'"'.(($matrixPointSize==$i)?' selected':'').'>'.$i.'</option>';
        
    echo '</select> 
        <input type="submit" value="GENERATE"></form><hr/>';
        
    // benchmark
   //QRtools::timeBenchmark();   
}

Wow guys, thought at least one person here would be able to assist me on this… any help is appreciated, the information i’m printing from the db is printing into divs but not the qrcode form and i really cant figure out why

Have you contacted: deltalab at poczta dot fm

QR generators create an image file as their output. You incorporate that into your web page using an <img> tag that calls the QR code generator as its src attribute.