title: scanning qr code using webcam, fetching the image from the wencam
body: <p>I have this code that scans and decode qr image with the help of this source code <a href="https://github.com/khanamiryan/php-qrcode-detector-decoder" rel="nofollow noreferrer">https://github.com/khanamiryan/php-qrcode-detector-decoder</a>, it scans the image file from your documents..but I want to scan the qr using my webcam.</p>
  
  <p>the qr code scanner script is this</p>
  
  <pre><code>  &lt;?php
  if ($_SERVER['REQUEST_METHOD'] != "POST"){
      header("location:take-attendance.php");
      die();
  }
  
  require "vendor/autoload.php";
  
  $qrcode = new Zxing\QrReader($_FILES['qrimage']['tmp_name']);
  $text = $qrcode-&gt;text();
  
  var_dump($text);
  
  ?&gt;
  </code></pre>
  
  <p>then my webcam that take snapshot goes like this</p>
  
  <pre><code> &lt;form action="decode.php" method="post" enctype="multipart/form-data"&gt;
  &lt;script src="webcam.js"&gt;&lt;/script&gt; &lt;!--source code script from github for webcam config--&gt;
  
      &lt;div id="my_camera" style="width:320px; height:240px;"&gt;&lt;/div&gt;
      &lt;div id="my_result"&gt;&lt;/div&gt;
  
      &lt;script type=text/javascript&gt;
          Webcam.attach( '#my_camera' );
  
          function take_snapshot() {
              Webcam.snap( function(data_uri) {
                  document.getElementById('my_result').innerHTML = '&lt;img src="'+data_uri+'"/&gt;';
              } );
          }
      &lt;/script&gt;
  
      &lt;a href="javascript:void(take_snapshot())"&gt;Take Snapshot&lt;/a&gt;
  </code></pre>
  
  <p>so I click the take snapshot the image will appear as an img src and I want that image to be fetch if I click scan so that means I need to replace this code</p>
  
  <pre><code>$qrcode = new Zxing\QrReader($_FILES['qrimage']['tmp_name']);
  </code></pre>
  
  <p>with the file name that is been generated when I click that snapshot which is this</p>
  
  <pre><code>&lt;img src="'+data_uri+'"/&gt;
  </code></pre>
  
  <p>but the thing is I don't know the format on how to write the code, this is my idea but it doesn't work though</p>
  
  <pre><code>$qrcode = new Zxing\QrReader($_FILES['data_uri']);
  </code></pre>
  
  <p>thanks in advance</p>