title: Uploading image in folder creating file path using php
body: <p>Using <a href="http://vamapaull.com/photo-booth-flash-webcam-image-capture/" rel="nofollow noreferrer">Photo Booth by vamapaull</a> 
   i am trying to capture image in folder.with my sql it was working fine but changing it to mysqli not able to upload.webcam takes snap but does not store image folder.(on wamp).Looking for slide show in output from stored images ID wise.</p>
  
  <pre><code> Table name  uploadimages ::   ID   Name    image   user_id 
      veiw.php
  ============================
  &lt;script type="text/javascript"&gt;
      hs.graphicsDir = 'graphics/';
      hs.align = 'center';
      hs.transitions = ['expand', 'crossfade'];
      hs.wrapperClassName = 'dark borderless floating-caption';
      hs.fadeInOut = true;
      hs.dimmingOpacity = .75;
  
      // Add the controlbar
      if (hs.addSlideshow) hs.addSlideshow({
          //slideshowGroup: 'group1',
          interval: 5000,
          repeat: false,
          useControls: true,
          fixedControls: 'fit',
          overlayOptions: {
              opacity: .6,
              position: 'bottom center',
              hideOnMouseOut: true
          }
      });
  &lt;/script&gt;
  &lt;script src="swfobject.js" language="javascript"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              var flashvars = {};
  
              var parameters = {};
              parameters.scale = "noscale";
              parameters.wmode = "window";
              parameters.allowFullScreen = "true";
              parameters.allowScriptAccess = "always";
  
              var attributes = {};
  
              swfobject.embedSWF("take_picture.swf", "main", "700", "400", "9", 
                      "expressInstall.swf", flashvars, parameters, attributes);
          &lt;/script&gt;
  
          &lt;script type="text/javascript"&gt;
              var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
              document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
          &lt;/script&gt;
  
          &lt;script type="text/javascript"&gt;
              var pageTracker = _gat._getTracker("UA-3097820-1");
              pageTracker._trackPageview();
          &lt;/script&gt;
          &lt;script type="text/javascript"&gt;
      var mainswf = new SWFObject("take_picture.swf", "main", "600", "400", "9", "#ffffff");
      mainswf.addParam("scale", "noscale");
      mainswf.addParam("wmode", "window");
      mainswf.addParam("allowFullScreen", "true");
      //mainswf.addVariable("requireLogin", "false");
      mainswf.write("flashArea");
  
   &lt;/script&gt;
  
  php code
  
  &lt;?php
      session_start();
      //This project is done by vamapaull: http://blog.vamapaull.com/
      include_once('db.php');
      if(isset($GLOBALS["HTTP_RAW_POST_DATA"])){
          $jpg = addslashes($GLOBALS["HTTP_RAW_POST_DATA"]);
          $img = addslashes($_GET["img"]);
          //$id= $_GET["id"];
          $vid=$_SESSION['vid'];
          //$image =addslashes(file_get_contents($_FILES["img"]["tmp_name"]));
          //$image_name = addslashes($_FILES["image"]["name"]);
          $filename = "images/poza_". mktime(). ".jpg";
          file_put_contents($filename, $jpg);
          mysqli_query($db  ,"INSERT INTO uploadimages (Name,image,user_id) VALUES ('$filename','$jpg','$vid')")or die(mysqli_error($db));
          } else{
          echo "Encoded JPEG information not received.";
      }
      ?&gt;
  
   -------------------------
   Other files can be seen at link given 
  http://vamapaull.com/photo-booth-flash-webcam-image-capture/  This how directory looks like.image attached.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gpQ87.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gpQ87.png" alt="Directory looks like this"></a></p>