<?php
   include('phpqrcode/qrlib.php');

    // how to save PNG codes to server
    function generarqrcode($urlseguimiento){


        $tempDir = "images_qr/";
    
    $codeContents = $urlseguimiento;
    
    // we need to generate filename somehow, 
    // with md5 or with database ID used to obtains $codeContents...
    $fileName = 'prueba'.md5($codeContents).'.png';
    
    $pngAbsoluteFilePath = $tempDir.$fileName;
    $urlRelativeFilePath = $tempDir.$fileName;
    
    // generating
    if (!file_exists($pngAbsoluteFilePath)) {
        QRcode::png($codeContents, $pngAbsoluteFilePath);

    } else {

    }
    return $fileName;
    }
    
    
    

    
?>