Jump to content

mindapolis

Member
  • Posts

    30
  • Joined

  • Last visited

Posts posted by mindapolis

  1. Here the xml file again

     

    <?xml version="1.0" encoding="utf-8"?>

    <item>

    <product>

    <id>WoofburgersAndFries </id>

    <title> Wayah's Woofburgers and fries</title>

    <description> Burger: Unbleached and rye flours, cheddar cheese, unsalter butter, beef broth, cornmeal, canola oil, garlic powder, seseme seeds, egg whites, beet and spinach powders.

    <br />

    Fries: Unbleached flour, cheddar cheese, chicken broth, garlic powder </description>

    <img alt = "Woof burgers and fries" src="http://auntievics.com/assets/WayahsWoofburgers.jpg" />

    <price> $9.95/lb</price>

    </product>

    <product>

    <id> BoChunkyPeanutButterChunchies </id>

    <title>Bo's Chunky Peanut Butter Chunchies </title>

    <description>Whole wheat flour, wheat germ, crunchy peanut butter, distilled water, rolled oats canola oil, eggs </description>

    <img alt "Bo's Peanut Butter Chunchies" src= "http://auntievics.com/assets/ChunckyPeamuttButterCrunchies.jpg" />

    <price> $9.95 </price>

    </product>

    </item>

  2. I'm getting this error now.

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 9: parser error : attributes construct error in D:\Hosting\5246561\html\functions.php on line 9

     

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <img alt = "Woof burgers and fries src="http://auntievics.com/assets/WayahsWoo'>http://auntievics.com/assets/WayahsWoo in D:\Hosting\5246561\html\functions.php on line 9

     

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in D:\Hosting\5246561\html\functions.php on line 9

     

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 9: parser error : Couldn't find end of Start Tag img line 9 in D:\Hosting\5246561\html\functions.php on line 9

     

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <img alt = "Woof burgers and fries src="http://auntievics.com/assets/WayahsWoo in D:\Hosting\5246561\html\functions.php on line 9

     

    Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in D:\Hosting\5246561\html\functions.php on line 9

     

    Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in D:\Hosting\5246561\html\functions.php:9 Stack trace: #0 D:\Hosting\5246561\html\functions.php(9): SimpleXMLElement->__construct('<?xml version="...') #1 D:\Hosting\5246561\html\treats.php(73): get_xml_catalog() #2 {main} thrown in D:\Hosting\5246561\html\functions.php on line 9

     

    here is the code again.

     

    <?php

    require_once("functions.php");

    session_name("treats");

    session_start();

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Auntie Vic's treats</title>

    <link href="doggyTreats.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

    .product {

    margin: 0 auto;

    }

    .product img {

    float:left;

    }

    #mainContent {

    margin: 0 auto;

    text-align:center;

    width:600px;

    }

    .description {

    width: 200px;

    padding-left: 5px;

    }

    .price {

    font-weight: bold;

    text-align:left;

    clear:both;

    }

    .addToCart {

    diaplay: block;

    text-align:right;

    }

    #catalog {

    margin-top: 50px;

    margin-left: 250px;

    }

    .products {

    width: 300px;

    text-align:center;

    padding-right:35px;

    padding-bottom: 6px;

    }

    .pics {

    text-align:center;

    }

    .description {

    padding-right: 25px;

    }

    </style>

    </head>

     

    <body>

    <div id = "navBar">

    <ul id="menu">

    <li class="menuOption"><a href="index.html">Home</a></li>

    <li class="menuOption"><a href="aboutUs.html">Management Team </a></li>

    <li class="menuOption"><a href="missionStatement.html">Mission Statement</a></li>

    <li class="menuOption"><a href="treats.html">Treats </a></li>

    <li class="menuOption"><a href="charities.html">Supported Charities</a></li>

    <li class="menuOption"><a href="order.html">Orders</a></li>

    </ul>

    </div>

    <div id="logo"><img src="assets/logo.gif" width="182" height="123" alt="logo" /></div>

    <div id = "mainContent">

     

    <?php

    $output = '.<table class="product">

    <tr>';

    foreach(get_xml_catalog() as $product)

    {

    $output .='

    <td class="product">

    <h2>'.$product->title.'</h2>

    <div>

    <img src=".$product->img">

    <span>

    '.$product->description.'

    </span>

    </div>

    <div class="price">

    '.$price->price.'

    </div>

    <div class="addToCart">

    // <a href="order.php?id='.$product->id.'">add to cart</a>

     

    </div>

    </td>';

    }

    $output .='

    </tr>

    </table>

     

    ';

    echo $output;

    ?>

    </div>

    <div id = "footer">

    Auntie Vic's Treatery <br />

    PO Box 34092 <br />

    Clermont, IN 46234 <br />

    317-701-0343 <br />

    <a href="mailto:auntievics@gmail.com">Email Us</a></div>

    </body>

    </html>

  3. <?php

    require_once("functions.php");

    session_name("treats");

    session_start();

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Auntie Vic's treats</title>

    <link href="doggyTreats.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

    .product {

    margin: 0 auto;

    }

    .product img {

    float:left;

    }

    #mainContent {

    margin: 0 auto;

    text-align:center;

    width:600px;

    }

    .description {

    width: 200px;

    padding-left: 5px;

    }

    .price {

    font-weight: bold;

    text-align:left;

    clear:both;

    }

    .addToCart {

    diaplay: block;

    text-align:right;

    }

    #catalog {

    margin-top: 50px;

    margin-left: 250px;

    }

    .products {

    width: 300px;

    text-align:center;

    padding-right:35px;

    padding-bottom: 6px;

    }

    .pics {

    text-align:center;

    }

    .description {

    padding-right: 25px;

    }

    </style>

    </head>

     

    <body>

    <div id = "navBar">

    <ul id="menu">

    <li class="menuOption"><a href="index.html">Home</a></li>

    <li class="menuOption"><a href="aboutUs.html">Management Team </a></li>

    <li class="menuOption"><a href="missionStatement.html">Mission Statement</a></li>

    <li class="menuOption"><a href="treats.html">Treats </a></li>

    <li class="menuOption"><a href="charities.html">Supported Charities</a></li>

    <li class="menuOption"><a href="order.html">Orders</a></li>

    </ul>

    </div>

    <div id="logo"><img src="assets/logo.gif" width="182" height="123" alt="logo" /></div>

    <div id = "mainContent">

     

    <?php

    $output = '.<table class="product">

    <tr>';

    foreach(get_xml_catalog() as $product)

    {

    $output .='

    <td class="product">

    <h2>'.$product->title.'</h2>

    <div>

    <img src="'.$product->img.' height="" Width="" />

    <span>

    '.$product->description.'

    </span>

    </div>

    <div class="price">

    '.$price->price.'

    </div>

    <div class="addToCart">

    <a href="#">add to cart</a>

     

    </div>

    </td>';

    }

    $output .='

    </tr>

    </table>

     

    ';

    echo $output;

    ?>

    </div>

    <div id = "footer">

    Auntie Vic's Treatery <br />

    PO Box 34092 <br />

    Clermont, IN 46234 <br />

    317-701-0343 <br />

    <a href="mailto:auntievics@gmail.com">Email Us</a></div>

    </body>

    </html>

  4. Hi, I'm doing the shopping cart video series and I can't get the product image to show up.

     

    here is the xml file

    <?xml version="1.0" encoding="utf-8"?>

    <item>

    <product>

    <id>WoofburgersAndFries </id>

    <title> Wayah's Woofburgers and fries</title>

    <description> Burger: Unbleached and rye flours, cheddar cheese, unsalter butter, beef broth, cornmeal, canola oil, garlic powder, seseme seeds, egg whites, beet and spinach powders.

    <br />

    Fries: Unbleached flour, cheddar cheese, chicken broth, garlic powder </description>

    <img>http://auntievics.com/assets/WayahsWoofburgers.jpg</img>

    <price> $9.95/lb</price>

    </product>

    <product>

    <id> BoChunkyPeanutButterChunchies </id>

    <title>Bo's Chunky Peanut Butter Chunchies </title>

    <description>Whole wheat flour, wheat germ, crunchy peanut butter, distilled water, rolled oats canola oil, eggs </description>

    <img>"http://auntievics.com/assets/ChunckyPeamuttButterCrunchies.jpg" </img>

    <price> $9.95 </price>

    </product>

    </item>

×
×
  • Create New...