title: Generating QR Code using PHP QrCode
body: <p>After using the PHP QrCode lib I discovered that for some reason when using a dynamic page with scripts and dialog boxes (JQuery) that when trying to output a QR code in a .png format I get weird symbols instead of the actual generated .png file.</p>
  
  <p>Heres what I have tried:</p>
  
  <p>Created a seperate file with just:</p>
  
  <pre><code>&lt;?php
  //include only that one, rest required files will be included from it
  include "phpqrcode/qrlib.php";
  
  QRcode::png('barrda554');
  ?&gt;
  </code></pre>
  
  <p>Works great,</p>
  
  <p>Attempt 2:</p>
  
  <p>File opened within a dialog box type using JQuery UI:</p>
  
  <pre><code>&lt;?php
  
  header stuff...
  include "phpqrcode/qrlib.php";
  ...
  ?&gt;
  &lt;html&gt;
  ...
    &lt;?php
     QRcode::png('barrda554');
    ?&gt;
  ..
  &lt;/html&gt;
  </code></pre>
  
  <p>In this attempt I get multiple funky symbols for some reason:</p>
  
  <pre><code>    �PNG  IHDRWWKK/PLTE���U��~�IDAT8��ѱ � P# �c��n :V�L�@�k 
  y��)�|F��5`ڸzHF|l���
  %Z"e�Ы�D{\�ގ����p`�f�eh�������k�[BJeJ�c����,�^�gu�m|Q��o��W����g�
      �#�s�&lt;�y��k�m��!v�.��(+�u���$s�-�n$߫&gt;�gR�`IEND�B`�
  </code></pre>
  
  <p>This has stumped me and I am unsure on how I should approach this to fix it.</p>
  
  <p>Let me know your ideas,</p>
  
  <p>David</p>
  
  <p>UPDATE:</p>
  
  <p>After putting <code>header('Content-Type: image/png');</code> within the file that JQuery opens, no cigar.</p>
  
  <p>Here is the actual file:</p>
  
  <p><a href="http://jsfiddle.net/T4nEP/" rel="nofollow">http://jsfiddle.net/T4nEP/</a></p>