title: How to send variables from index.php to ajaximage.php in ajax image uploading?
body: <p>I need to send users logid and input id to server along with image uploaded with jquery. Only thing i get to send is image.  Here is my current code:
  index.php</p>
  
  <pre><code>&lt;?php
  include('db.php');
  session_start();
  $session_id='1'; //$session id
  ?&gt;
  
  &lt;script type="text/javascript" src="scripts/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="scripts/jquery.form.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" &gt;
   $(document).ready(function() { 
  
              $('.photoimg').live('change', function()            { 
              var id=$(this).attr("id");
                  var split=id.split("photoimg");
  var splited=split[1];
                  alert(splited); 
  
                     $("#preview").html('');
                  $("#preview").html('&lt;img src="loader.gif" alt="Uploading...."/&gt;');
              $("#imageform").ajaxForm({
                          target: '#preview'
          }).submit();
  
              });
          }); 
  &lt;/script&gt;
  
  
  &lt;form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'&gt;&lt;br&gt;
  Upload your image1 &lt;input type="file" name="photoimg" id="photoimg1" class="photoimg"/&gt;&lt;br&gt;
  Upload your image2 &lt;input type="file" name="photoimg" id="photoimg2" class="photoimg"/&gt;&lt;br&gt;
  Upload your image3 &lt;input type="file" name="photoimg" id="photoimg3" class="photoimg"/&gt;&lt;br&gt;
  &lt;/form&gt;
  &lt;div id='preview'&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Please help</p>