Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Print variable in different php file

Hi I have shopping cart and i want print item name in different php file. I try this.

<?php
        if(!empty($_SESSION["cart"]))
        {
            $total = 0;
            foreach($_SESSION["cart"] as $keys => $values)
            {
                $product_cart = $values["item_name"];
                ?>
                <tr>
                    <td><?php echo $values["item_name"]; ?></td> <?php session_start(); $_SESSION['produktik'] = $values["item_name"] ;  ?>

                    <td><?php echo $values["item_quantity"] ?></td>
                    <td><?php echo $values["product_price"]; ?>€</td>
                    <td><?php echo number_format($values["item_quantity"] * $values["product_price"], 2); ?>€</td>
                    <td><a href="shop.php?action=delete&id=<?php echo $values["product_id"]; ?>"><span class="text-danger">X</span></a></td>
                </tr>

and second php file is

    <pre>
 <?php  
 session_start();

 echo $_SESSION['produktik'];
 ?>

    </pre>
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!