QuestionQuestion

Using a web page for your business, you will be adding a shopping cart allowing users to add and remove items from it.

Modify your Products page to include an Add link, under each item (this link is a simple <A href> tag that will direct the user to another page, that will add the item to a cookie list). When the user clicks Add, he or she is directed to the Shopping Cart page (a PHP page that runs on the server side) where the item is stored inside a cookie.

Your Products page needs to also have a Remove link next to the Add link. When the user clicks Remove, the item needs to be removed by simply deleting its information from the cookie where the item was stored. It is a good idea to use the item Name or ID as an indicator to determine which cookie to remove.

The Shopping Cart PHP page needs to add the item to a cookie list and then display the contents of the cookie list to the user—to show the items added to the cart. The items can be displayed in a table format. Remember, each item is stored in a different cookie or you can use one cookie to store all the items, you simply add a separator between each item. For example, a cookie could contain the following items: Hat, Pants, and T-Shirt.

You can use PHP script to parse the cookie content by splitting the contents into three separate items or you may also use an array of cookies to store multiple items.

Submit your code as well as a test plan, in a 4- to 5-page Microsoft Word document consisting of:
- Screenshots of your project (showing design, data entered, and displayed)
- A paragraph explaining how you tested your project
- All HTML or PHP script zipped under one file

Support your responses with examples.

Cite any sources in APA format.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

<?php
       // whehter there is any cookie
            if (isset($_SERVER['HTTP_COOKIE'])) {
                // create a new table
       ?>      
      
       <table border="1" >
            <col width="10">
            <col width="130">
            <col width="80">
            <thead>
                <tr>
                   <th></th>
                   <th>Name</th>
                   <th>Price</th>
                </tr>
            </thead>
            <tbody>
                <?php
                // iterate over cookies
                   foreach ( $_COOKIE as $key => $value )
                   {
                        echo "<tr>", PHP_EOL;
                        echo "<td>","","</td>", PHP_EOL;
                        echo "<td>",$key,"</td>", PHP_EOL;...
$90.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Web Development (HTML, XML, PHP, JavaScript, Adobe, Flash, etc.) Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats