Cookie Objects Class

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cookie Objects Class

    This class was designed to store and retrieve objects made of composite data items of a custom type in cookies. The information is stored like a bidimensional array of n objects of m items.

    This classe can be used in applications based on shopping carts.

    The class provides means to:

    - Add new objects
    - Add new items to each object
    - Store all objects information in a cookie
    - Test if a cookie was previously stored
    - Retrieve the objects information from a cookie
    - Delete an object from the list of objects
    - Remove cookies
    Attached Files
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    CookieObjects.php
    Code:
    <?php  
    ############################################################# 
    # 
    # CookieObject Class 
    # 
    #       version 0.1 
    #        License GPL 
    # 
    # (c) 2004 Guillermo de Jesus Perez Chavero 
    #        E-mail: chavero81@yahoo.es 
    #        Description: allow you to add "n" Single Objects with  "m" Items, and you can set a tipe off objects, all into a cookie 
    #        Example: 
    #        My objects: 
    #            - Cup: Color, size, type 
    #            - plate: Color, size, Type 
    #            - spoon: Color, size, Type 
    # 
    #        Set cookie 
    #        $cookie_k = new CookieObjects("cookie_kitchen",'Table'); 
    #        $cookie_k->NewObject(); 
    #        $cookie_k->addItem( "Cup" ); 
    #        $cookie_k->addItem( "Red" ); 
    #        $cookie_k->addItem( 10 ); 
    #        $cookie_k->addItem( "porcelain" ); 
    #        $cookie_k->NewObject(); 
    #        $cookie_k->addItem( "Plate" ); 
    #        $cookie_k->addItem( "White" ); 
    #        $cookie_k->addItem( 11 ); 
    #        $cookie_k->addItem( "porcelain" ); 
    #        $cookie_k->NewObject(); 
    #        $cookie_k->addItem( "Spoon" ); 
    #        $cookie_k->addItem( "silver" ); 
    #        $cookie_k->addItem( 14 ); 
    #        $cookie_k->addItem( "silver" ); 
    # 
    #        Read cookie 
    #        $cookie_k = new CookieObjects("cookie_kitchen",'Table'); 
    #        if ($cookie_k->Exist()) { 
    #            $cookie_k->ReadCookie(); 
    #            $cookie_k->ParseCookie(); 
    #            echo "<br>Type: ".$$cookie_k->GetOType(); 
    #            for ($i = 0; $i<$cookie_k->CountObjects(); $i++) { 
    #                echo "<br>Object: $i "; 
    #                for ($j = 0; $j<$cookie_k->CountItemss() ; $j++) { 
    #                    echo '$cookie_k->PData[$i][$j].' '; 
    #                } 
    #            } 
    #        } 
    # 
    #        Delete a object : plate 
    #        $cookie_k->deleteObject(0,"plate"); 
    # 
    #        Remove a cookie 
    #        $cookie_k->RemoveCookie(); 
    # 
    #        -> Have fun !!! :D 
    #         
    ############################################################## 
    class CookieObjects { 
            const     Tokenini = 'XXXXX'; 
            const     TokenObject = 'YYYYY'; 
            const     TokenData = 'ZZZZZ'; 
            private $Cookie_Name = ''; 
            private $Data = ''; 
            private $CountO = 0; 
            private $CountI = 0; 
            private $OType; 
            public     $PData = array(); 
    
            #Constructor I 
            public function __construct( $Cookie_Name , $OType ) { 
                $this->Cookie_Name = $Cookie_Name; 
                $this->SetOTypeAndClear( $OType ); 
            }//Constructor I 
    
            #Sobre escribe el OType / overwrite Object type 
            public function SetOTypeAndClear ( $OType ) { 
                $this->ClearData(); 
                $this->OType = $OType; 
                $this->Data = $OType . CookieObjects::Tokenini; 
            } 
    
            #permite conocer si existe la cookie / Allow to know if a cookie exist 
            public function Exist() { 
                try { 
                    if (isset($_COOKIE[$this->Cookie_Name])) return true; 
                } 
                catch ( Exception $e ) { 
                    echo "Error - function Exist()."; 
                    return false; 
                } 
                return false; 
            }//Exist 
    
            #Permite crear/Sobrescribir la cookie // Create/overwrite a cookie 
            public function CreateCookie ( $Overwrite ) { 
                try { 
                    if ($Overwrite) { 
                        if(setcookie ($this->Cookie_Name,$this->Data)==TRUE) return true; 
                    } 
                    else {  
                        if ($this->Exist()) return false; 
                        else if(setcookie ($this->Cookie_Name,$this->Data)==TRUE) return true; 
                    } 
                } 
                catch ( Exception $e ) { 
                    echo "Error - function CreateCookie($Overwrite)."; 
                    return false; 
                }             
                return false; 
            }//Create 
             
            #Remueve una cookie / Remove the cookie 
            public function RemoveCookie () { 
                try { 
                    if(setcookie ($this->Cookie_Name, "", time() - 3600)==TRUE) { 
                        $this->ClearData(); 
                        return true; 
                    } 
                } 
                catch ( Exception $e ) { 
                    echo "Error - RemoveCookie()."; 
                    return false; 
                } 
                return false; 
            }//Create 
             
            #Borra todos los datos / Clear all data 
            public function ClearData() { 
                 $this->OType = "";  
                 $this->Data = ""; 
                 $this->PData = nil; 
                 $this->CountO = 0; 
                 $this->CountI = 0; 
            }//ClearData 
             
            #Lee el contenido de la cookie / Read the cookie 
            public function ReadCookie () { 
                try { 
                    if ($this->Exist()) { 
                        $this->Data = $_COOKIE[$this->Cookie_Name]; 
                        return true; 
                    } 
                } 
                catch ( Exception $e ) { 
                    echo "Error - ReadCookie()."; 
                    return false; 
                } 
                return false; 
            }//ReadCookie 
             
            #obtiene los resultados en un arreglo / Get the data into array (DATA) 
            public function ParseCookie () { 
                try { 
                    $this->PData = array(); 
                    $Tokenini = explode( CookieObjects::Tokenini , $this->Data );  //Extract the Data OType & Objects 
                    $this->OType = $Tokenini[0]; 
                    if ($Tokenini[1]!="") { 
                        $Objects = explode( CookieObjects::TokenObject , $Tokenini[1] );  //Extract the Data SingleObj 1 & Graphic 2 
                        $this->CountO = sizeof ($Objects); 
                        foreach ($Objects as $SingleObj) { 
                            $Items = explode( CookieObjects::TokenData , $SingleObj );  //Extract the Data SingleObj 1 & Graphic 2 
                            $this->CountI = sizeof ($Items); 
                            array_push ($this->PData, $Items); 
                        } 
                    } 
                    else $this->CountO = 0; 
                } 
                catch ( Exception $e ) { 
                    echo "Error - ParseCookie()."; 
                    return false; 
                } 
            }//ParseCookie 
             
            #Nos indica el tipo de objeto // return the object type 
            public function GetOType() { 
                return $this->OType; 
            }//GETOType 
             
            #regresa el numero de graficas contenidas / Count the objects 
            public function CountObjects() { 
                return $this->CountO; 
            }//CountObjects 
             
            #regresa el numero de items contenidas, debe de ser constante para todos / Count the items it must be equal for all objects 
            public function CountItems() { 
                return $this->CountI; 
            }//CountItems 
             
            #Agrega el token para reconocer que existe un nuevo objecto / allow to add a new object into the cookie 
            public function NewObject() { 
                if ($this->CountO>0) $this->Data .= CookieObjects::TokenObject; 
                $this->CountO++; 
                $this->CountI = 0; 
            }//NewObject 
    
            #agrega el token y el valor del item // add a item for object "It must be equal (number of items) for all objects" 
            public function AddItem( $Item ) { 
                if ($this->CountI>0)    $this->Data .= CookieObjects::TokenData . $Item; 
                else     $this->Data .= $Item; 
                $this->CountI++; 
                return true; 
            }//addItem 
             
            #borra un objeto donde coincida el valor dependiendo de index de un item / Remove the object with a value of a item (index of item) 
            public function DeleteObject ( $Index, $Value ) { 
                try { 
                    $this->ParseCookie(); 
                    $Size_i = $this->CountO; 
                    $Size_j = $this->CountI; 
                    $this->CountO = 0; 
                    $this->CountI = 0; 
                    $this->Data = $this->OType. CookieObjects::Tokenini; 
                    for ( $i=0; $i<$Size_i; $i++) { 
                        if ($this->PData[$i][$Index]==$Value) {} 
                        else { 
                            $this->NewObject(); 
                            for ($j=0; $j<$Size_j; $j++) { 
                                $this->AddItem( $this->PData[$i][$j] ); 
                            } 
                        } 
                    } 
                    $this->ParseCookie(); 
                } 
                catch ( Exception $e ) { 
                    echo "Erro - deleteItem ( $Index, $Value )"; 
                    return false; 
                } 
            }//deleteItem 
             
            #Permite la imprecion en sobrecarga 
            public function __toString() { 
                return $this->Data; 
            }//__toString 
             
            #Retorna la version de la clase 
            final function Version()  { 
                return 'CookieObject Class - Version 0.1'; 
            } 
    
    }//class MySQLClass 
    ?>
    GetData.php
    Code:
    <?php 
        require_once('CookieObjects.php'); 
        switch ($_GET['Action']){ 
            case "Add": 
                    $cookie_k = new CookieObjects("cookie_kitchen",'MyTypeofObject'); 
                    if ($cookie_k->Exist()) { 
                             $cookie_k->ReadCookie(); 
                            $cookie_k->ParseCookie(); 
                    } 
                    $cookie_k->NewObject(); 
                    $cookie_k->AddItem($_POST['Obj']); 
                    $cookie_k->AddItem($_POST['Color']); 
                    $cookie_k->AddItem($_POST['Size']); 
                    $cookie_k->AddItem($_POST['Type']); 
                    if (!$cookie_k->CreateCookie(true)) { echo "<p><font color='#ff0000'>Error - CreateCookie(true). :*(... </font></p>";} 
                    break; 
            case "Remove": 
                    $cookie_k = new CookieObjects("cookie_kitchen",'MyTypeofObject'); 
                    if ($cookie_k->Exist()) { 
                             $cookie_k->ReadCookie(); 
                            $cookie_k->ParseCookie(); 
                            switch($_POST['rb']){ 
                                case "O"; 
                                    $Index = 0; 
                                    $Value = $_POST['Obj']; 
                                    break; 
                                case "C"; 
                                    $Index = 1; 
                                    $Value = $_POST['Color']; 
                                    break; 
                                case "S"; 
                                    $Index = 2; 
                                    $Value = $_POST['Size']; 
                                    break; 
                                case "T"; 
                                    $Index = 3; 
                                    $Value = $_POST['Type']; 
                                    break; 
                            }; 
                            $cookie_k->DeleteObject ( $Index, $Value ); 
                            if (!$cookie_k->CreateCookie(true)) { echo "<p><font color='#ff0000'>Error - CreateCookie(true). :*(... </font></p>";} 
                    } 
                     break; 
            case "RemoveCookie": 
                    $cookie_k = new CookieObjects("cookie_kitchen",'MyTypeofObject'); 
                    if ($cookie_k->Exist()) $cookie_k->RemoveCookie(); 
                    break; 
            default: 
                     break; 
        }; 
         
    ?> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <link href="Languaje.css" rel="stylesheet" type="text/css"> 
    <meta http-equiv="imagetoolbar" content="false"> 
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class"> 
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class"> 
    <META NAME="Language" CONTENT="Español/English"> 
    <META NAME="Copyright" CONTENT="© Chavero Soft"> 
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Robots" CONTENT="Index"> 
    <title>Get Data</title> 
    </head> 
    <body class="Normal"> 
    <p><label class="Spanish">Accion:</label> / <label class="English">Action: </label> 
    <?php  
        switch ($_GET['Action']){ 
            case "Add": 
                    echo "<label class='Spanish'>Añadir objeto</label> / <label class='English'>Add object</label>. </p>"; 
                    break; 
            case "Remove": 
                    echo "<label class='Spanish'>Remover objeto</label> / <label class='English'>Remove object</label>. </p>"; 
                    echo "<label class='Spanish'>Indice </label> / <label class='English'>Index</label>: ".$Index."<br>"; 
                    echo "<label class='Spanish'>Valor </label> / <label class='English'>Value</label>: ".$Value."<br>"; 
                    echo "Objeto: ".$_POST['Obj']."<br>"; 
                    echo "Color: ".$_POST['Color']."<br>"; 
                    echo "Size: ".$_POST['Size']."<br>"; 
                    echo "Type: ".$_POST['Type']."<br>"; 
                    echo "Seleccion: ".$_POST['rb']."<br>"; 
                    break; 
            case "RemoveCookie": 
                    echo "<label class='Spanish'>Remover Cookie</label> / <label class='English'>Remove Cookie</label>. </p>"; 
                    break; 
            default: 
                     echo "<label class='Spanish'>Ninguno</label> / <label class='English'>None.</label>. </p>"; 
                     break; 
        }; 
        if (isset($cookie_k)) { 
             echo "<hr />"; 
             echo "<label class='Spanish'>Datos en la cookie</label> / <label class='English'>Cookie Data</label>: "; 
             echo $cookie_k; 
             echo "<hr />"; 
             echo "<br><label class='Spanish'>Objetos</label> / <label class='English'>Objects</label>: ".$cookie_k->CountObjects(); 
             echo "<br><label class='Spanish'>Items por cada Objeto</label> / <label class='English'>Items for each Objects</label>: ".$cookie_k->CountItems(); 
             echo "<br><br>".$cookie_k->Version(); 
        } 
        else { 
             echo "<p align='center'><label class='Spanish'>La cookie no existe.</label> / <label class='English'>The cookie doesn't exist.</label>. </p>"; 
        } 
    ?> 
    
    <script language=JavaScript type=text/javascript> 
    //<!-- 
        parent.bottom_right.location = "ViewDataI.php"; 
    //--> 
    </script> 
    </body> 
    </html>
    Index.php
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <title>Cookie Test - CookieObjects Class</title> 
    <meta http-equiv="imagetoolbar" content="false"> 
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class"> 
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class"> 
    <META NAME="Language" CONTENT="Español/English"> 
    <META NAME="Copyright" CONTENT="© Chavero Soft"> 
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Robots" CONTENT="Index"> 
    </head> 
    <frameset cols="400px,*"             frameborder="no" border="1" scrolling="auto" framespacing="0"> 
    <frame src="SendData.php" name="left"          frameborder="no" border="0" scrolling="auto" marginwidth="0" marginheight="0" /> 
      <frameset rows="50%,*"             frameborder="no" border="1" scrolling="auto" framespacing="0"> 
        <frame src="GetData.php" name="top_right"     frameborder="no" border="1" scrolling="auto" marginwidth="0" marginheight="0" /> 
        <frame src="ViewDataI.php" name="bottom_right"  frameborder="no" border="1" scrolling="auto" marginwidth="0" marginheight="0" /> 
      </frameset> 
    </frameset> 
    <noframes> 
    <?php echo "Hola";?> 
     <center><font face="verdana,arial" size="3">Your browser does not support frames!</center></font> 
    </noframes> 
    </html>
    Languaje.css
    Code:
    .English {
    	font-family: luxi sans, verdana, geneva, arial, helvetica, sans-serif;
    	font-size: 10px;
    	font-weight:bold;
    	color: #0033ff;
    }
    
    .Spanish {
    	font-family: luxi sans, verdana, geneva, arial, helvetica, sans-serif;
    	font-size: 10px;
    	font-weight:bold;
    	color: #336666;
    } 
    
    .Normal {
    	font-family: luxi sans, verdana, geneva, arial, helvetica, sans-serif;
    	font-size: 10px;
    	font-weight:bold;
    	color: #333333;
    }
     
    body {
    	background-color: #3399FF;
    }
    SendData.php
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <base target="top_right">
    <link href="Languaje.css" rel="stylesheet" type="text/css">
    <title>Send Data / Envia Datos</title>
    <meta http-equiv="imagetoolbar" content="false">
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class">
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero">
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class">
    <META NAME="Language" CONTENT="Español/English">
    <META NAME="Copyright" CONTENT="© Chavero Soft">
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero">
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero">
    <META NAME="Robots" CONTENT="Index">
    <style type="text/css">
    <!--
    .style3 {font-size: 9px}
    -->
    </style>
    </head>
    <body class="Normal">
    <div align="center">
      <h1>Cookie Test  CookieObjects Class</h1>
    </div>
    <p align="center"><label class="Spanish">Español</label> / <label class="English">English</label></p>
    <p><label class="Spanish">Definimos un tipo de objeto</label> / <label class="English">Define a type of object</label>:
    <label class="Spanish">Objeto de cosina</label> / <label class="English">Kitchen object</label>. </p>
    
    <ul>
    	<label class="Spanish">Los Objetos</label> / <label class="English">The Objects</label>:
    		<li><label class="Spanish">Taza</label> / <label class="English">Cup</label>: Color, <label class="Spanish">Tamaño</label> / <label class="English"> size</label>, <label class="Spanish">Tipo</label> / <label class="English">Type</label></li>
    		<li><label class="Spanish">Plato</label> / <label class="English">plate</label>: Color, <label class="Spanish">Tamaño</label> / <label class="English">size</label>, <label class="Spanish">Tipo</label> / <label class="English">Type</label></li>
    		<li><label class="Spanish">Cuchara</label> / <label class="English">spoon</label>: Color, <label class="Spanish">Tamaño</label> / <label class="English">size</label>, <label class="Spanish">Tipo</label> / <label class="English">Type</label></li>
    </ul>
    
    	<label class="Spanish">Las acciones</label> / <label class="English">The actions</label>:
    <hr />
    <form action="GetData.php?Action=Add" method="post">
    <table border="0" cellspacing="0" cellpadding="2" summary="" align="center">
     <tr>
      <td class="Normal"><label class="Spanish">Objeto</label> / <label class="English"> Object</label>:</td>
      <td>
    	<select name="Obj" class="Normal" >
    		<option value="Taza / Cup">Taza / Cup</option>
    		<option value="Plato / Plate">Plato / plate</option>
    		<option value="Cuchara / Spoon">Cuchara / spoon</option>
    	</select>
    	</td>
     </tr>
     <tr>
      <td class="Normal">Color:</td>
      <td><input type="text" name="Color" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><label class="Spanish">Tamaño</label> / <label class="English"> size</label>:</td>
      <td><input type="text" name="Size" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><label class="Spanish">Tipo</label> / <label class="English">Type</label></td>
      <td><input type="text" name="Type" class="Normal" /></td>
     </tr>
     <tr>
      <td colspan="2" align="right"><button type="submit" class="Normal">Añadir / Add</button></td>
     </tr>
    </table>
    </form>
    <hr />
    <form action="GetData.php?Action=Remove" method="post">
    <table border="0" cellspacing="0" cellpadding="2" summary="" align="center">
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="O" class="Normal"  checked><label class="Spanish">Objeto</label> / <label class="English"> Object</label>:</td>
      <td>
    	<select name="Obj" class="Normal" >
    		<option value="Taza / Cup">Taza / Cup</option>
    		<option value="Plato / Plate">Plato / plate</option>
    		<option value="Cuchara / Spoon">Cuchara / spoon</option>
    	</select>
    	</td>
     </tr>
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="C" class="Normal">Color:</td>
      <td><input type="text" name="Color" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="S" class="Normal"><label class="Spanish">Tamaño</label> / <label class="English"> size</label>:</td>
      <td><input type="text" name="Size" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="T" class="Normal"><label class="Spanish">Tipo</label> / <label class="English">Type</label></td>
      <td><input type="text" name="Type" class="Normal" /></td>
     </tr>
     <tr>
      <td colspan="2" align="right"><button type="submit" class="Normal" >Remover / Remove</button></td>
     </tr>
    </table>
    </form>
    <hr />
    <form action="GetData.php?Action=RemoveCookie" method="post">
    <button type="submit" class="Normal" >Remover Cookie / Remove Cookie</button>
    ViewDataI.php
    Code:
    <?php 
        require_once('CookieObjects.php'); 
    ?> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    
    <html> 
    <head> 
    <link href="Languaje.css" rel="stylesheet" type="text/css"> 
    <meta http-equiv="imagetoolbar" content="false"> 
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class"> 
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class"> 
    <META NAME="Language" CONTENT="Español/English"> 
    <META NAME="Copyright" CONTENT="© Chavero Soft"> 
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Robots" CONTENT="Index"> 
    <title>View Data I</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    </head> 
    <body class="Normal"> 
    <p align="center"><label class="Spanish">Datos cargados desde la cookies.</label> / <label class="English">Data loaded from cookie.</label></p> 
    <?php 
    
        $cookie_k = new CookieObjects("cookie_kitchen","Any - Doesn't matter"); 
        if ($cookie_k->Exist()) { 
                 $cookie_k->ReadCookie(); 
                $cookie_k->ParseCookie(); 
                if ($cookie_k->CountObjects()>0) { 
                    $Width = 96/$cookie_k->CountItems(); 
                    echo '<table summary="" cellpadding="0" cellspacing="1" align="center"'. 
                         'title="" width="500" border="0" bgcolor="black">'. 
                         '<td bgcolor="silver" colspan="5" align="center" class="normal"><label class="Spanish">Objeto de cosina</label> / <label class="English">Kitchen object</label></td>'. 
                         '<tr>'. 
                         '<td>'. 
                          '<table summary="Heder" cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="silver">'. 
                         '<tr bgcolor="silver" align="center" class="normal">'. 
                         '    <td width="'.$Width.'%"><label class="Spanish">Objetos</label> / <label class="English">Objects</label></td>'. 
                         '    <td width="'.$Width.'%">Color</td>'. 
                         '    <td width="'.$Width.'%"><label class="Spanish">Tamaño</label> / <label class="English"> size</label></td>'. 
                         '    <td width="'.$Width.'%"><label class="Spanish">Tipo</label> / <label class="English">Type</label></td>'. 
                         '<td width="4%" >&nbsp;</td>'. 
                         '</tr>'. 
                         '</table>'. 
                         '<div style="height:150px; overflow: auto;">'.  
                          '<table summary="Content" cellpadding="0" cellspacing="0" width="100%" border="1">'; 
                    $Width = 100/$cookie_k->CountItems(); 
                    for ($i = 0; $i<$cookie_k->CountObjects(); $i++) { 
                        echo '<tr bgcolor="#FFFFFF" class="normal" align="center" >'; 
                        for ($j = 0; $j<$cookie_k->CountItems() ; $j++) { 
                            echo '<td width="'.$Width.'%">'.$cookie_k->PData[$i][$j].'</td>'; 
                        } 
                        echo '</tr>'; 
                    } 
                    echo '</table></div>'. 
                         '</td>'. 
                          '</tr>'. 
                          '</table>'; 
                    } 
                else{ 
                     echo "<p align='center'><label class='Spanish'>La cookie existe, pero no tiene objetos</label> / <label class='English'>The cookie exist, but it hasn't objects</label>. </p>"; 
                } 
        } 
        else { 
             echo "<p align='center'><label class='Spanish'>La cookie no existe.</label> / <label class='English'>The cookie doesn't exist.</label>. </p>"; 
         
        } 
    ?> 
    <p align="center"><button type="button" onclick="window.open('ViewDataI.php','','location=0,status=0,scrollbars=0,width=550,height=275');" class="Normal">PopUp</button></p> 
    </body> 
    </html>
    Added after 5 minutes:

    CookieObjects.php
    Code:
    <?php  
    ############################################################# 
    # 
    # CookieObject Class 
    # 
    #       version 0.1 
    #        License GPL 
    # 
    # (c) 2004 Guillermo de Jesus Perez Chavero 
    #        E-mail: chavero81@yahoo.es 
    #        Description: allow you to add "n" Single Objects with  "m" Items, and you can set a tipe off objects, all into a cookie 
    #        Example: 
    #        My objects: 
    #            - Cup: Color, size, type 
    #            - plate: Color, size, Type 
    #            - spoon: Color, size, Type 
    # 
    #        Set cookie 
    #        $cookie_k = new CookieObjects("cookie_kitchen",'Table'); 
    #        $cookie_k->NewObject(); 
    #        $cookie_k->addItem( "Cup" ); 
    #        $cookie_k->addItem( "Red" ); 
    #        $cookie_k->addItem( 10 ); 
    #        $cookie_k->addItem( "porcelain" ); 
    #        $cookie_k->NewObject(); 
    #        $cookie_k->addItem( "Plate" ); 
    #        $cookie_k->addItem( "White" ); 
    #        $cookie_k->addItem( 11 ); 
    #        $cookie_k->addItem( "porcelain" ); 
    #        $cookie_k->NewObject(); 
    #        $cookie_k->addItem( "Spoon" ); 
    #        $cookie_k->addItem( "silver" ); 
    #        $cookie_k->addItem( 14 ); 
    #        $cookie_k->addItem( "silver" ); 
    # 
    #        Read cookie 
    #        $cookie_k = new CookieObjects("cookie_kitchen",'Table'); 
    #        if ($cookie_k->Exist()) { 
    #            $cookie_k->ReadCookie(); 
    #            $cookie_k->ParseCookie(); 
    #            echo "<br>Type: ".$$cookie_k->GetOType(); 
    #            for ($i = 0; $i<$cookie_k->CountObjects(); $i++) { 
    #                echo "<br>Object: $i "; 
    #                for ($j = 0; $j<$cookie_k->CountItemss() ; $j++) { 
    #                    echo '$cookie_k->PData[$i][$j].' '; 
    #                } 
    #            } 
    #        } 
    # 
    #        Delete a object : plate 
    #        $cookie_k->deleteObject(0,"plate"); 
    # 
    #        Remove a cookie 
    #        $cookie_k->RemoveCookie(); 
    # 
    #        -> Have fun !!! :D 
    #         
    ############################################################## 
    class CookieObjects { 
            const     Tokenini = 'XXXXX'; 
            const     TokenObject = 'YYYYY'; 
            const     TokenData = 'ZZZZZ'; 
            private $Cookie_Name = ''; 
            private $Data = ''; 
            private $CountO = 0; 
            private $CountI = 0; 
            private $OType; 
            public     $PData = array(); 
    
            #Constructor I 
            public function __construct( $Cookie_Name , $OType ) { 
                $this->Cookie_Name = $Cookie_Name; 
                $this->SetOTypeAndClear( $OType ); 
            }//Constructor I 
    
            #Sobre escribe el OType / overwrite Object type 
            public function SetOTypeAndClear ( $OType ) { 
                $this->ClearData(); 
                $this->OType = $OType; 
                $this->Data = $OType . CookieObjects::Tokenini; 
            } 
    
            #permite conocer si existe la cookie / Allow to know if a cookie exist 
            public function Exist() { 
                try { 
                    if (isset($_COOKIE[$this->Cookie_Name])) return true; 
                } 
                catch ( Exception $e ) { 
                    echo "Error - function Exist()."; 
                    return false; 
                } 
                return false; 
            }//Exist 
    
            #Permite crear/Sobrescribir la cookie // Create/overwrite a cookie 
            public function CreateCookie ( $Overwrite ) { 
                try { 
                    if ($Overwrite) { 
                        if(setcookie ($this->Cookie_Name,$this->Data)==TRUE) return true; 
                    } 
                    else {  
                        if ($this->Exist()) return false; 
                        else if(setcookie ($this->Cookie_Name,$this->Data)==TRUE) return true; 
                    } 
                } 
                catch ( Exception $e ) { 
                    echo "Error - function CreateCookie($Overwrite)."; 
                    return false; 
                }             
                return false; 
            }//Create 
             
            #Remueve una cookie / Remove the cookie 
            public function RemoveCookie () { 
                try { 
                    if(setcookie ($this->Cookie_Name, "", time() - 3600)==TRUE) { 
                        $this->ClearData(); 
                        return true; 
                    } 
                } 
                catch ( Exception $e ) { 
                    echo "Error - RemoveCookie()."; 
                    return false; 
                } 
                return false; 
            }//Create 
             
            #Borra todos los datos / Clear all data 
            public function ClearData() { 
                 $this->OType = "";  
                 $this->Data = ""; 
                 $this->PData = nil; 
                 $this->CountO = 0; 
                 $this->CountI = 0; 
            }//ClearData 
             
            #Lee el contenido de la cookie / Read the cookie 
            public function ReadCookie () { 
                try { 
                    if ($this->Exist()) { 
                        $this->Data = $_COOKIE[$this->Cookie_Name]; 
                        return true; 
                    } 
                } 
                catch ( Exception $e ) { 
                    echo "Error - ReadCookie()."; 
                    return false; 
                } 
                return false; 
            }//ReadCookie 
             
            #obtiene los resultados en un arreglo / Get the data into array (DATA) 
            public function ParseCookie () { 
                try { 
                    $this->PData = array(); 
                    $Tokenini = explode( CookieObjects::Tokenini , $this->Data );  //Extract the Data OType & Objects 
                    $this->OType = $Tokenini[0]; 
                    if ($Tokenini[1]!="") { 
                        $Objects = explode( CookieObjects::TokenObject , $Tokenini[1] );  //Extract the Data SingleObj 1 & Graphic 2 
                        $this->CountO = sizeof ($Objects); 
                        foreach ($Objects as $SingleObj) { 
                            $Items = explode( CookieObjects::TokenData , $SingleObj );  //Extract the Data SingleObj 1 & Graphic 2 
                            $this->CountI = sizeof ($Items); 
                            array_push ($this->PData, $Items); 
                        } 
                    } 
                    else $this->CountO = 0; 
                } 
                catch ( Exception $e ) { 
                    echo "Error - ParseCookie()."; 
                    return false; 
                } 
            }//ParseCookie 
             
            #Nos indica el tipo de objeto // return the object type 
            public function GetOType() { 
                return $this->OType; 
            }//GETOType 
             
            #regresa el numero de graficas contenidas / Count the objects 
            public function CountObjects() { 
                return $this->CountO; 
            }//CountObjects 
             
            #regresa el numero de items contenidas, debe de ser constante para todos / Count the items it must be equal for all objects 
            public function CountItems() { 
                return $this->CountI; 
            }//CountItems 
             
            #Agrega el token para reconocer que existe un nuevo objecto / allow to add a new object into the cookie 
            public function NewObject() { 
                if ($this->CountO>0) $this->Data .= CookieObjects::TokenObject; 
                $this->CountO++; 
                $this->CountI = 0; 
            }//NewObject 
    
            #agrega el token y el valor del item // add a item for object "It must be equal (number of items) for all objects" 
            public function AddItem( $Item ) { 
                if ($this->CountI>0)    $this->Data .= CookieObjects::TokenData . $Item; 
                else     $this->Data .= $Item; 
                $this->CountI++; 
                return true; 
            }//addItem 
             
            #borra un objeto donde coincida el valor dependiendo de index de un item / Remove the object with a value of a item (index of item) 
            public function DeleteObject ( $Index, $Value ) { 
                try { 
                    $this->ParseCookie(); 
                    $Size_i = $this->CountO; 
                    $Size_j = $this->CountI; 
                    $this->CountO = 0; 
                    $this->CountI = 0; 
                    $this->Data = $this->OType. CookieObjects::Tokenini; 
                    for ( $i=0; $i<$Size_i; $i++) { 
                        if ($this->PData[$i][$Index]==$Value) {} 
                        else { 
                            $this->NewObject(); 
                            for ($j=0; $j<$Size_j; $j++) { 
                                $this->AddItem( $this->PData[$i][$j] ); 
                            } 
                        } 
                    } 
                    $this->ParseCookie(); 
                } 
                catch ( Exception $e ) { 
                    echo "Erro - deleteItem ( $Index, $Value )"; 
                    return false; 
                } 
            }//deleteItem 
             
            #Permite la imprecion en sobrecarga 
            public function __toString() { 
                return $this->Data; 
            }//__toString 
             
            #Retorna la version de la clase 
            final function Version()  { 
                return 'CookieObject Class - Version 0.1'; 
            } 
    
    }//class MySQLClass 
    ?>
    GetData.php
    Code:
    <?php 
        require_once('CookieObjects.php'); 
        switch ($_GET['Action']){ 
            case "Add": 
                    $cookie_k = new CookieObjects("cookie_kitchen",'MyTypeofObject'); 
                    if ($cookie_k->Exist()) { 
                             $cookie_k->ReadCookie(); 
                            $cookie_k->ParseCookie(); 
                    } 
                    $cookie_k->NewObject(); 
                    $cookie_k->AddItem($_POST['Obj']); 
                    $cookie_k->AddItem($_POST['Color']); 
                    $cookie_k->AddItem($_POST['Size']); 
                    $cookie_k->AddItem($_POST['Type']); 
                    if (!$cookie_k->CreateCookie(true)) { echo "<p><font color='#ff0000'>Error - CreateCookie(true). :*(... </font></p>";} 
                    break; 
            case "Remove": 
                    $cookie_k = new CookieObjects("cookie_kitchen",'MyTypeofObject'); 
                    if ($cookie_k->Exist()) { 
                             $cookie_k->ReadCookie(); 
                            $cookie_k->ParseCookie(); 
                            switch($_POST['rb']){ 
                                case "O"; 
                                    $Index = 0; 
                                    $Value = $_POST['Obj']; 
                                    break; 
                                case "C"; 
                                    $Index = 1; 
                                    $Value = $_POST['Color']; 
                                    break; 
                                case "S"; 
                                    $Index = 2; 
                                    $Value = $_POST['Size']; 
                                    break; 
                                case "T"; 
                                    $Index = 3; 
                                    $Value = $_POST['Type']; 
                                    break; 
                            }; 
                            $cookie_k->DeleteObject ( $Index, $Value ); 
                            if (!$cookie_k->CreateCookie(true)) { echo "<p><font color='#ff0000'>Error - CreateCookie(true). :*(... </font></p>";} 
                    } 
                     break; 
            case "RemoveCookie": 
                    $cookie_k = new CookieObjects("cookie_kitchen",'MyTypeofObject'); 
                    if ($cookie_k->Exist()) $cookie_k->RemoveCookie(); 
                    break; 
            default: 
                     break; 
        }; 
         
    ?> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <link href="Languaje.css" rel="stylesheet" type="text/css"> 
    <meta http-equiv="imagetoolbar" content="false"> 
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class"> 
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class"> 
    <META NAME="Language" CONTENT="Español/English"> 
    <META NAME="Copyright" CONTENT="© Chavero Soft"> 
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Robots" CONTENT="Index"> 
    <title>Get Data</title> 
    </head> 
    <body class="Normal"> 
    <p><label class="Spanish">Accion:</label> / <label class="English">Action: </label> 
    <?php  
        switch ($_GET['Action']){ 
            case "Add": 
                    echo "<label class='Spanish'>Añadir objeto</label> / <label class='English'>Add object</label>. </p>"; 
                    break; 
            case "Remove": 
                    echo "<label class='Spanish'>Remover objeto</label> / <label class='English'>Remove object</label>. </p>"; 
                    echo "<label class='Spanish'>Indice </label> / <label class='English'>Index</label>: ".$Index."<br>"; 
                    echo "<label class='Spanish'>Valor </label> / <label class='English'>Value</label>: ".$Value."<br>"; 
                    echo "Objeto: ".$_POST['Obj']."<br>"; 
                    echo "Color: ".$_POST['Color']."<br>"; 
                    echo "Size: ".$_POST['Size']."<br>"; 
                    echo "Type: ".$_POST['Type']."<br>"; 
                    echo "Seleccion: ".$_POST['rb']."<br>"; 
                    break; 
            case "RemoveCookie": 
                    echo "<label class='Spanish'>Remover Cookie</label> / <label class='English'>Remove Cookie</label>. </p>"; 
                    break; 
            default: 
                     echo "<label class='Spanish'>Ninguno</label> / <label class='English'>None.</label>. </p>"; 
                     break; 
        }; 
        if (isset($cookie_k)) { 
             echo "<hr />"; 
             echo "<label class='Spanish'>Datos en la cookie</label> / <label class='English'>Cookie Data</label>: "; 
             echo $cookie_k; 
             echo "<hr />"; 
             echo "<br><label class='Spanish'>Objetos</label> / <label class='English'>Objects</label>: ".$cookie_k->CountObjects(); 
             echo "<br><label class='Spanish'>Items por cada Objeto</label> / <label class='English'>Items for each Objects</label>: ".$cookie_k->CountItems(); 
             echo "<br><br>".$cookie_k->Version(); 
        } 
        else { 
             echo "<p align='center'><label class='Spanish'>La cookie no existe.</label> / <label class='English'>The cookie doesn't exist.</label>. </p>"; 
        } 
    ?> 
    
    <script language=JavaScript type=text/javascript> 
    //<!-- 
        parent.bottom_right.location = "ViewDataI.php"; 
    //--> 
    </script> 
    </body> 
    </html>
    Index.php
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <title>Cookie Test - CookieObjects Class</title> 
    <meta http-equiv="imagetoolbar" content="false"> 
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class"> 
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class"> 
    <META NAME="Language" CONTENT="Español/English"> 
    <META NAME="Copyright" CONTENT="© Chavero Soft"> 
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Robots" CONTENT="Index"> 
    </head> 
    <frameset cols="400px,*"             frameborder="no" border="1" scrolling="auto" framespacing="0"> 
    <frame src="SendData.php" name="left"          frameborder="no" border="0" scrolling="auto" marginwidth="0" marginheight="0" /> 
      <frameset rows="50%,*"             frameborder="no" border="1" scrolling="auto" framespacing="0"> 
        <frame src="GetData.php" name="top_right"     frameborder="no" border="1" scrolling="auto" marginwidth="0" marginheight="0" /> 
        <frame src="ViewDataI.php" name="bottom_right"  frameborder="no" border="1" scrolling="auto" marginwidth="0" marginheight="0" /> 
      </frameset> 
    </frameset> 
    <noframes> 
    <?php echo "Hola";?> 
     <center><font face="verdana,arial" size="3">Your browser does not support frames!</center></font> 
    </noframes> 
    </html>
    Languaje.css
    Code:
    .English {
    	font-family: luxi sans, verdana, geneva, arial, helvetica, sans-serif;
    	font-size: 10px;
    	font-weight:bold;
    	color: #0033ff;
    }
    
    .Spanish {
    	font-family: luxi sans, verdana, geneva, arial, helvetica, sans-serif;
    	font-size: 10px;
    	font-weight:bold;
    	color: #336666;
    } 
    
    .Normal {
    	font-family: luxi sans, verdana, geneva, arial, helvetica, sans-serif;
    	font-size: 10px;
    	font-weight:bold;
    	color: #333333;
    }
     
    body {
    	background-color: #3399FF;
    }
    SendData.php
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <base target="top_right">
    <link href="Languaje.css" rel="stylesheet" type="text/css">
    <title>Send Data / Envia Datos</title>
    <meta http-equiv="imagetoolbar" content="false">
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class">
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero">
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class">
    <META NAME="Language" CONTENT="Español/English">
    <META NAME="Copyright" CONTENT="© Chavero Soft">
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero">
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero">
    <META NAME="Robots" CONTENT="Index">
    <style type="text/css">
    <!--
    .style3 {font-size: 9px}
    -->
    </style>
    </head>
    <body class="Normal">
    <div align="center">
      <h1>Cookie Test  CookieObjects Class</h1>
    </div>
    <p align="center"><label class="Spanish">Español</label> / <label class="English">English</label></p>
    <p><label class="Spanish">Definimos un tipo de objeto</label> / <label class="English">Define a type of object</label>:
    <label class="Spanish">Objeto de cosina</label> / <label class="English">Kitchen object</label>. </p>
    
    <ul>
    	<label class="Spanish">Los Objetos</label> / <label class="English">The Objects</label>:
    		<li><label class="Spanish">Taza</label> / <label class="English">Cup</label>: Color, <label class="Spanish">Tamaño</label> / <label class="English"> size</label>, <label class="Spanish">Tipo</label> / <label class="English">Type</label></li>
    		<li><label class="Spanish">Plato</label> / <label class="English">plate</label>: Color, <label class="Spanish">Tamaño</label> / <label class="English">size</label>, <label class="Spanish">Tipo</label> / <label class="English">Type</label></li>
    		<li><label class="Spanish">Cuchara</label> / <label class="English">spoon</label>: Color, <label class="Spanish">Tamaño</label> / <label class="English">size</label>, <label class="Spanish">Tipo</label> / <label class="English">Type</label></li>
    </ul>
    
    	<label class="Spanish">Las acciones</label> / <label class="English">The actions</label>:
    <hr />
    <form action="GetData.php?Action=Add" method="post">
    <table border="0" cellspacing="0" cellpadding="2" summary="" align="center">
     <tr>
      <td class="Normal"><label class="Spanish">Objeto</label> / <label class="English"> Object</label>:</td>
      <td>
    	<select name="Obj" class="Normal" >
    		<option value="Taza / Cup">Taza / Cup</option>
    		<option value="Plato / Plate">Plato / plate</option>
    		<option value="Cuchara / Spoon">Cuchara / spoon</option>
    	</select>
    	</td>
     </tr>
     <tr>
      <td class="Normal">Color:</td>
      <td><input type="text" name="Color" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><label class="Spanish">Tamaño</label> / <label class="English"> size</label>:</td>
      <td><input type="text" name="Size" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><label class="Spanish">Tipo</label> / <label class="English">Type</label></td>
      <td><input type="text" name="Type" class="Normal" /></td>
     </tr>
     <tr>
      <td colspan="2" align="right"><button type="submit" class="Normal">Añadir / Add</button></td>
     </tr>
    </table>
    </form>
    <hr />
    <form action="GetData.php?Action=Remove" method="post">
    <table border="0" cellspacing="0" cellpadding="2" summary="" align="center">
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="O" class="Normal"  checked><label class="Spanish">Objeto</label> / <label class="English"> Object</label>:</td>
      <td>
    	<select name="Obj" class="Normal" >
    		<option value="Taza / Cup">Taza / Cup</option>
    		<option value="Plato / Plate">Plato / plate</option>
    		<option value="Cuchara / Spoon">Cuchara / spoon</option>
    	</select>
    	</td>
     </tr>
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="C" class="Normal">Color:</td>
      <td><input type="text" name="Color" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="S" class="Normal"><label class="Spanish">Tamaño</label> / <label class="English"> size</label>:</td>
      <td><input type="text" name="Size" class="Normal" /></td>
     </tr>
     <tr>
      <td class="Normal"><input type="radio" name="rb" value="T" class="Normal"><label class="Spanish">Tipo</label> / <label class="English">Type</label></td>
      <td><input type="text" name="Type" class="Normal" /></td>
     </tr>
     <tr>
      <td colspan="2" align="right"><button type="submit" class="Normal" >Remover / Remove</button></td>
     </tr>
    </table>
    </form>
    <hr />
    <form action="GetData.php?Action=RemoveCookie" method="post">
    <button type="submit" class="Normal" >Remover Cookie / Remove Cookie</button>
    ViewDataI.php
    Code:
    <?php 
        require_once('CookieObjects.php'); 
    ?> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    
    <html> 
    <head> 
    <link href="Languaje.css" rel="stylesheet" type="text/css"> 
    <meta http-equiv="imagetoolbar" content="false"> 
    <META NAME="Title" CONTENT="Cookie Test  CookieObjects Class"> 
    <META NAME="Author" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Keywords" CONTENT="Cookie, PHP5, Class"> 
    <META NAME="Language" CONTENT="Español/English"> 
    <META NAME="Copyright" CONTENT="© Chavero Soft"> 
    <META NAME="Designer" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Publisher" CONTENT="Guillermo de Jesus Perez Chavero"> 
    <META NAME="Robots" CONTENT="Index"> 
    <title>View Data I</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    </head> 
    <body class="Normal"> 
    <p align="center"><label class="Spanish">Datos cargados desde la cookies.</label> / <label class="English">Data loaded from cookie.</label></p> 
    <?php 
    
        $cookie_k = new CookieObjects("cookie_kitchen","Any - Doesn't matter"); 
        if ($cookie_k->Exist()) { 
                 $cookie_k->ReadCookie(); 
                $cookie_k->ParseCookie(); 
                if ($cookie_k->CountObjects()>0) { 
                    $Width = 96/$cookie_k->CountItems(); 
                    echo '<table summary="" cellpadding="0" cellspacing="1" align="center"'. 
                         'title="" width="500" border="0" bgcolor="black">'. 
                         '<td bgcolor="silver" colspan="5" align="center" class="normal"><label class="Spanish">Objeto de cosina</label> / <label class="English">Kitchen object</label></td>'. 
                         '<tr>'. 
                         '<td>'. 
                          '<table summary="Heder" cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="silver">'. 
                         '<tr bgcolor="silver" align="center" class="normal">'. 
                         '    <td width="'.$Width.'%"><label class="Spanish">Objetos</label> / <label class="English">Objects</label></td>'. 
                         '    <td width="'.$Width.'%">Color</td>'. 
                         '    <td width="'.$Width.'%"><label class="Spanish">Tamaño</label> / <label class="English"> size</label></td>'. 
                         '    <td width="'.$Width.'%"><label class="Spanish">Tipo</label> / <label class="English">Type</label></td>'. 
                         '<td width="4%" >&nbsp;</td>'. 
                         '</tr>'. 
                         '</table>'. 
                         '<div style="height:150px; overflow: auto;">'.  
                          '<table summary="Content" cellpadding="0" cellspacing="0" width="100%" border="1">'; 
                    $Width = 100/$cookie_k->CountItems(); 
                    for ($i = 0; $i<$cookie_k->CountObjects(); $i++) { 
                        echo '<tr bgcolor="#FFFFFF" class="normal" align="center" >'; 
                        for ($j = 0; $j<$cookie_k->CountItems() ; $j++) { 
                            echo '<td width="'.$Width.'%">'.$cookie_k->PData[$i][$j].'</td>'; 
                        } 
                        echo '</tr>'; 
                    } 
                    echo '</table></div>'. 
                         '</td>'. 
                          '</tr>'. 
                          '</table>'; 
                    } 
                else{ 
                     echo "<p align='center'><label class='Spanish'>La cookie existe, pero no tiene objetos</label> / <label class='English'>The cookie exist, but it hasn't objects</label>. </p>"; 
                } 
        } 
        else { 
             echo "<p align='center'><label class='Spanish'>La cookie no existe.</label> / <label class='English'>The cookie doesn't exist.</label>. </p>"; 
         
        } 
    ?> 
    <p align="center"><button type="button" onclick="window.open('ViewDataI.php','','location=0,status=0,scrollbars=0,width=550,height=275');" class="Normal">PopUp</button></p> 
    </body> 
    </html>
    Last edited by riderz; 15.06.11, 15:13.
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    Comment

    Working...
    X