title: Print variable in different php file
body: <p>Hi I have shopping cart and i want print item name in different php file. I try this.</p>
  
  <pre><code>&lt;?php
          if(!empty($_SESSION["cart"]))
          {
              $total = 0;
              foreach($_SESSION["cart"] as $keys =&gt; $values)
              {
                  $product_cart = $values["item_name"];
                  ?&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;?php echo $values["item_name"]; ?&gt;&lt;/td&gt; &lt;?php session_start(); $_SESSION['produktik'] = $values["item_name"] ;  ?&gt;
  
                      &lt;td&gt;&lt;?php echo $values["item_quantity"] ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $values["product_price"]; ?&gt;€&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo number_format($values["item_quantity"] * $values["product_price"], 2); ?&gt;€&lt;/td&gt;
                      &lt;td&gt;&lt;a href="shop.php?action=delete&amp;id=&lt;?php echo $values["product_id"]; ?&gt;"&gt;&lt;span class="text-danger"&gt;X&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  </code></pre>
  
  <p>and second php file is</p>
  
  <pre><code>    &lt;pre&gt;
   &lt;?php  
   session_start();
  
   echo $_SESSION['produktik'];
   ?&gt;
  
      &lt;/pre&gt;
  </code></pre>