title: add form inside div that is inside php
body: <p>Can I use form inside div that is inside php?
  for example:</p>
  
  <pre><code>&lt;?php
  some php code
  &lt;div class="something"&gt;
  ...
  ...
  ...
  &lt;form ...&gt;
  ...
  ...
  ...
  &lt;/form&gt;
  &lt;/div&gt;
  ?&gt;
  </code></pre>
  
  <p>EDIT:
  this is my code and it is a php file:</p>
  
  <pre><code>&lt;?php
  /*
   * @component VM2tags
   * @copyright Copyright (C) 2008-2012 Adrien Roussel
   * @license : GNU/GPL
   * @Website : http://www.nordmograph.com
   */
  // No direct access to this file
  defined('_JEXEC') or die('Restricted access');
  $tag                        = JRequest::getVar('tag');
  $products                   = $this-&gt;products;
  $juri                       = JURI::base();
  $doc                        = &amp;JFactory::getDocument();
  $doc-&gt;addStylesheet($juri.'components/com_vm2tags/assets/css/style.css');
  JHTML::_('behavior.tooltip');
  $cparams                    =&amp; JComponentHelper::getParams('com_vm2tags');
  $vm_itemid                  = $cparams-&gt;getValue('vm_itemid');
  $vm2tags_itemid             = $cparams-&gt;getValue('vm2tags_itemid');
  $show_price                     = $cparams-&gt;getValue('show_price','1');
  $credits                    = $cparams-&gt;getValue('credits','0');
  echo '&lt;h1&gt;'.JText::_('').' '.$tag.'&lt;/h1&gt;';
  echo '&lt;div class="pagination" &gt;';
  echo '&lt;/div&gt;';
  function jsonRemoveUnicodeSequences($struct) {
     return preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($struct));
  }
  
  
  foreach($products as $product){
      $product_url = JRoute::_('index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id='.$product-&gt;virtuemart_product_id.'&amp;virtuemart_category_id='.$product-&gt;virtuemart_category_id.'&amp;Itemid='.$vm_itemid);
      echo '&lt;div class="product1" &gt;';
      echo '&lt;div class="product_thumb" &gt;';
          $product_thumb =$product-&gt;file_url_thumb;
          if ($product_thumb =='')
              $product_thumb =  'components/com_virtuemart/assets/images/vmgeneral/noimage.gif';
          echo '&lt;a href="'.$product_url.'" &gt;&lt;img src="'.$juri.$product_thumb.'" height="90" alt="img" /&gt;&lt;/a&gt;';
      echo '&lt;/div&gt;';  
          echo '&lt;div class="product_name" &gt;';
          echo '&lt;a href="'.$product_url.'" &gt;'.ucfirst($product-&gt;product_name).'&lt;/a&gt;';
          echo '&lt;/div&gt;';
          if($show_price &gt; 0 ){
              echo '&lt;div class="product_price" &gt;';
              //echo $product-&gt;product_price;
  
              $price_format                   = $this-&gt;price_format;
                  $symbol                         = $price_format[7];
                  $currency_positive_style        = $price_format[11];
                  $currency_id                    = $price_format[0];
                  $currency                       = $price_format[4];
                  $currency_decimal_place         = $price_format[8];
  
                  if($show_price=='1')  // without tax
                      $list_item__product_price = $product-&gt;product_price;
                  if($show_price=='2')    // with tax(es)
                      $list_item__product_price = Vm2tagsModelproductslist::applytaxes( $product-&gt;product_price   , $product-&gt;virtuemart_category_id ,  $product-&gt;virtuemart_vendor_id)  ;
  
  
                      $price_val =  number_format($list_item__product_price , $currency_decimal_place ,   '.' , ' ' );
                      $print_price = str_replace('{number}' ,$price_val ,$currency_positive_style);
                      $print_price = str_replace('{symbol}' ,$symbol ,$print_price);
                  echo '&lt;a href="'.$product_url.'" &gt;'. $print_price .'&lt;/a&gt;';
  
              echo '&lt;/div&gt;';
          }
  
                  echo '&lt;div class="product-details" &gt;';
          echo JHTML::link (JRoute::_('index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id='.$product-&gt;virtuemart_product_id.'&amp;virtuemart_category_id='.$product-&gt;virtuemart_category_id.'&amp;Itemid='.$vm_itemid), JText::_ ('جزئیات'), array('title' =&gt; $product-&gt;product_name, 'class' =&gt; 'product-details2'));
          echo '&lt;/div&gt;';
  </code></pre>
  
  <p>I want to add my form here</p>
  
  <pre><code>    echo '&lt;/div&gt;';
  }
  
  echo '&lt;div style="clear:both;"&gt;&lt;/div&gt;';
  echo '&lt;div class="pagination" &gt;';
  echo $this-&gt;pagination-&gt;getResultsCounter();
  echo $this-&gt;pagination-&gt;getPagesLinks();
  echo $this-&gt;pagination-&gt;getPagesCounter();
  echo '&lt;/div&gt;';
  if($credits)
      echo '&lt;div style="width:100%;text-align:center;color:#cccccc;font-size:10px;"&gt;Powered by Nordmograph.com&lt;/div&gt;';
  
  ?&gt;
  </code></pre>
  
  <p>and I want to add this form inside  div class=product1
  .my form is:</p>
  
  <pre><code>&lt;form method="post" class="product" action="index.php" id="addtocartproduct&lt;?php echo $products-&gt;virtuemart_product_id ?&gt;"&gt;
      &lt;div class="addtocart-bar"&gt;
              &lt;?php // Display the quantity box ?&gt;
              &lt;!-- &lt;label for="quantity&lt;?php echo $product-&gt;virtuemart_product_id;?&gt;" class="quantity_box"&gt;&lt;?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?&gt;: &lt;/label&gt; --&gt;
              &lt;span class="quantity-box"&gt;
                  &lt;input style="display:none;" type="text" class="quantity-input" name="quantity[]" value="1" /&gt;
              &lt;/span&gt;
  
              &lt;?php // Display the quantity box END ?&gt;
  
              &lt;?php // Add the button
              $button_lbl = JText::_('اضافه به کارت');
              $button_cls = ''; //$button_cls = 'addtocart_button';
              if (VmConfig::get('check_stock') == '1' &amp;&amp; !$product-&gt;product_in_stock) {
                  $button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY');
                  $button_cls = 'notify-button';
              } ?&gt;
  
              &lt;?php // Display the add to cart button ?&gt;
              &lt;span class="addtocart-button1"&gt;
                  &lt;input type="submit" name="addtocart" class="addtocart-button" value="&lt;?php echo $button_lbl ?&gt;" title="&lt;?php echo $button_lbl ?&gt;" /&gt;
              &lt;/span&gt;
  
          &lt;div class="clear"&gt;&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;?php // Display the add to cart button END ?&gt;
          &lt;input type="hidden" class="pname" value="&lt;?php echo $product-&gt;product_name ?&gt;"&gt;
          &lt;input type="hidden" name="option" value="com_virtuemart" /&gt;
          &lt;input type="hidden" name="view" value="cart" /&gt;
          &lt;noscript&gt;&lt;input type="hidden" name="task" value="add" /&gt;&lt;/noscript&gt;
          &lt;input type="hidden" name="virtuemart_product_id[]" value="&lt;?php echo $product-&gt;virtuemart_product_id ?&gt;" /&gt;
          &lt;?php /** @todo Handle the manufacturer view */ ?&gt;
          &lt;input type="hidden" name="virtuemart_manufacturer_id" value="&lt;?php echo $product-&gt;virtuemart_manufacturer_id ?&gt;" /&gt;
          &lt;input type="hidden" name="virtuemart_category_id[]" value="&lt;?php echo $product-&gt;virtuemart_category_id ?&gt;" /&gt;
  &lt;/form&gt;
  </code></pre>